Repository navigation
0.3.0a2
Pre-release
Pre-release
0.3.0a2 - 2026-11-14
Bugfixes
- Bypass the cache for requests with a non-empty
AuthorizationorCookieheader by
default. Addcache_authenticated=Trueto opt in with an identity-awarekey_builder;
opting in with the default key builder raisesValueErrorfor authenticated requests.
Backend error logs now report only the endpoint, namespace, and exception type; they no
longer include the cache key, exception message, or traceback.
Clear or rotate the cache namespace when upgrading from versions that cached authenticated
responses. #12 - InMemory backend:
expire=Nonenow means no expiration instead of immediate expiry, and each
backend instance has its own store and lock. Existing process-local entries are not shared
between instances; use a shared backend for cross-process caching. #13 - Emit
Cache-Control: max-ageonly when the effective expiry is valid and non-negative.
expire=Noneand no-expiration InMemory hits no longer producemax-age=Noneor
max-age=-1;ETagand the cache-status header are still emitted.expire=0keeps the
legacy fallback to the globalexpirevalue. #14 - Use a stable SHA-256 digest for the ETag and emit it as a quoted weak validator
(W/"<digest>").If-None-Matchnow uses weak comparison, supports comma-separated lists
and*, and is evaluated on both cache hits and misses, including after
Cache-Control: no-cache. Malformed entity-tags are ignored. The ETag value changes once
when upgrading; clients revalidate and receive the new value. #15 - Namespace the internal
_spec_typemarker as__fastapi_cache_spec_type__so user payloads
with_spec_typeare preserved.JsonCodernow caches only simpleJSONResponseobjects
(status200,application/json, no custom headers, no background task) and bypasses other
non-JSON responses (StreamingResponse,FileResponse,RedirectResponse, plainResponse,
templates). Responses withSet-Cookie,Cache-Control: no-store/private, or a background
task are never cached, regardless of the coder. The injectedresponseobject is also
checked before a cache read and before writing; cookies,Cache-Control: no-store/private,
background tasks, non-200statuses, and custom headers bypass the cache.PickleCodercaches serializable response
objects it can reproduce faithfully and bypasses streaming, file, and template responses. Old
cache entries written with_spec_typeare treated as user data; flush the namespace if you
cachedatetime/date/Decimalvalues. #16
Improved Documentation
- Document the published
0.3.0a1release and pin the alpha install commands. #11 - Document the
0.3.0a2release status, pin the alpha install commands, and record the tested
Redis/redis-py compatibility. The auth/privacy, InMemory,Cache-Control, ETag,
_spec_type, and response-bypass fixes are now available in0.3.0a2. #17