mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Previously, any 2xx response with a non-empty payload on a route with
`label('cache', true)` was persisted to the filesystem cache for 180
days, and clients had no per-URL way to invalidate it. If an incident
produced a non-image body on one of these routes (e.g. a truncated
read, a fallback body, or a partial Imagick output) the bad content
was served from cache indefinitely.
- Load hook: honor `Cache-Control: no-cache` / `no-store` on the
request. Skip the cache load, let the action re-run, and let the
existing save path overwrite the poisoned entry. Emits
`X-Appwrite-Cache: bypass` and a telemetry counter.
- Save hook: refuse to cache unless the response `Content-Type` is
`image/*`. Every route currently opting into caching sets an image
content type via `Response::file()`; anything else is an error or
fallback and must not become the authoritative cached answer.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>