> ## Documentation Index
> Fetch the complete documentation index at: https://docs.snapopa.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Caching & CDN

> Configure response caching and CDN storage

Optimize performance and reduce costs with caching and CDN storage.

## Response Cache

Cache captures to avoid redundant processing for identical requests.

```json theme={null}
{
  "url": "https://example.com",
  "responseCache": {
    "enabled": true,
    "ttl": 86400
  }
}
```

| Parameter | Type    | Default | Range                       |
| --------- | ------- | ------- | --------------------------- |
| `enabled` | boolean | `false` | -                           |
| `ttl`     | integer | 86400   | 60-2592000 (1min - 30 days) |
| `nonce`   | string  | -       | max 32 chars                |

### Cache Key

Caches are keyed by a hash of the full request parameters. Same URL with different options = different cache entry.

### Cache Busting

Use `nonce` to force a fresh capture:

```json theme={null}
{
  "url": "https://example.com",
  "responseCache": {
    "enabled": true,
    "ttl": 86400,
    "nonce": "v2"
  }
}
```

## CDN Storage

All captures are stored on our global CDN. Configure storage duration and auto-refresh.

```json theme={null}
{
  "url": "https://example.com",
  "cdnTtl": 604800,
  "persistence": {
    "enabled": false
  }
}
```

| Parameter                     | Type    | Default | Range              |
| ----------------------------- | ------- | ------- | ------------------ |
| `cdnTtl`                      | integer | 86400   | 60-2592000         |
| `persistence.enabled`         | boolean | `false` | -                  |
| `persistence.refreshInterval` | integer | 0       | 0 or 21600-2592000 |

## Permanent Captures

Store captures indefinitely for archival or permalinks.

```json theme={null}
{
  "url": "https://example.com",
  "persistence": {
    "enabled": true
  }
}
```

<Tip>
  Permanent captures are accessible via the Permalinks section in your dashboard.
</Tip>

## Auto-Refresh

Automatically refresh captures at set intervals (minimum 6 hours).

```json theme={null}
{
  "url": "https://example.com",
  "persistence": {
    "enabled": true,
    "refreshInterval": 86400
  }
}
```

This is useful for:

* Monitoring pages for changes
* Keeping cached thumbnails up-to-date
* Scheduled archiving

## Cache Response Indicator

The response includes `fromCache` to indicate cache status:

```json theme={null}
{
  "success": true,
  "data": {
    "fileUrl": "https://cdn.snapopa.com/...",
    "fromCache": true
  }
}
```

## TTL Reference

| Duration | Seconds |
| -------- | ------- |
| 1 minute | 60      |
| 1 hour   | 3600    |
| 1 day    | 86400   |
| 1 week   | 604800  |
| 30 days  | 2592000 |
