> ## Documentation Index
> Fetch the complete documentation index at: https://libops-renovate-github-com-libops-sitectl-0-x.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# cache

> Warm caches to speed up Islandora site page load times.

Run cache warmers after a fresh deployment or restart to ensure the first real visitors don't experience slow load times while the IIIF server processes images on demand.

## cache mirador

Pre-warm the Mirador IIIF viewer cache for paged content items.

When the IIIF server has not yet cached a paged item's child images, the first visitor to that
page experiences slow load times while the server processes the images. This command fetches a
list of paged content URLs from either a JSON endpoint or a file, reads the Mirador settings
embedded in each page's Drupal settings JSON, and warms the related IIIF resources before real
visitors arrive.

Pass exactly one of:
`--endpoint`   JSON endpoint returning URL objects
`--url-file`   text file with one URL per line

```bash theme={null}
sitectl isle cache mirador
```

| Flag         | Default | Description                                                                                         |
| ------------ | ------- | --------------------------------------------------------------------------------------------------- |
| `--delay`    | `1s`    | How long to sleep between HTTP warm requests.                                                       |
| `--endpoint` |         | JSON endpoint returning an array of objects with a url field. Mutually exclusive with `--url-file`. |
| `--limit`    | `0`     | Maximum number of URLs to warm. Use 0 to paginate through all endpoint pages.                       |
| `--mode`     | `ttfb`  | Mirador warm mode: ttfb, browse, or full.                                                           |
| `--restart`  | `false` | Discard saved Mirador warm progress and restart from the beginning.                                 |
| `--url-file` |         | Path to a file containing one URL per line. Mutually exclusive with `--endpoint`.                   |
| `--workers`  | `1`     | Number of concurrent warm workers.                                                                  |

## When to run it

Run `cache mirador` after:

* Deploying a new version of your Islandora site.
* Restarting the IIIF server.
* Ingesting a large batch of new paged content.

The command no longer uses a browser. It fetches each page directly, extracts the embedded `drupal-settings-json`, reads the Mirador manifest ID, then warms selected IIIF URLs from the manifest.

Pass exactly one input source:

* `--endpoint` for a paginated JSON feed of URL objects.
* `--url-file` for a plain text file with one URL per line.

## Warm modes

Use `--mode` to choose what gets warmed from each manifest:

* `ttfb` default: the first full image URL and the first 10 thumbnails.
* `browse`: every full image URL after the first, plus thumbnails starting at 11 if present.
* `full`: the first full image URL, all thumbnails, and every remaining full image URL.

## Resume behavior

Progress is saved under `~/.sitectl` as URLs complete, so canceling a long run does not force a full restart next time.

* Normal reruns resume automatically.
* `--restart` discards saved progress and starts over.

## Request pacing

Use `--delay` to control how long the command sleeps between HTTP warm requests. The default is `1s`.
