zshot/cliDownload

Caching

--server-cache stores successful renders on disk and answers repeat GETs from the store.

Keys

An entry’s key combines the server’s startup arguments with the request’s URL and render parameters. Restarting with different arguments leaves earlier entries unreachable. The signature is not part of the key, so a signed GET and an unsigned POST for the same render share one entry. MCP requests are never cached.

Reads and Writes

A GET / is served from a fresh entry when one exists. A POST / always renders, then writes its result over any entry for later GETs. An entry stays fresh for --server-cache-ttl seconds; the oldest entries are evicted once the store passes --server-cache-size-limit.

Each hit is checked against its stored digest; a mismatch evicts the entry and renders again. A cache error never fails a render.

Response Headers

HeaderValue
Cache-Controlpublic, max-age=<seconds of freshness left>
ETagthe body’s content digest
Last-Modifiedwhen the entry was rendered
Ageseconds since then, on a hit

A GET whose If-None-Match matches the ETag, or whose If-Modified-Since is at or after Last-Modified, answers 304.

Purging

DELETE / takes the same arguments as a render, as query parameters or a JSON body, and is authorized like a GET.

RequestResponse
arguments with a fresh entry204; the entry expires
arguments with no fresh entry410
no arguments204; every entry expires
any, without --server-cache404

On a server with signed URLs and no credential auth, sign the DELETE’s query; a JSON body carries no signature and is rejected.