Repository navigation
What's New in v1.2.0
- In-flight request coalescing (
coalesce=True): per-key singleflight deduplication for concurrent sync threads and async tasks, with leak-free cleanup on errors or aborted streams. - Stale-if-error resilience (
stale_if_error): serve the last expired cached entry (response.extensions["stale"] = True) on upstream 5xx responses or transport errors, with optional max-stale window. - Per-request overrides & smart filtering: support
extensions={"cache": {"disabled", "force_refresh", "ttl", "key"}},should_cache(request, response)(streaming-safe for GraphQL200 OKerror payloads), andurls_expire_afterfnmatchURL patterns (0= never cache). - Actionable
CacheMissError, secret scrubbing & diffable JSON cassettes:CacheMissErrorsuggests closest recorded keys (highlighting body/header mismatches on the same URL),scrub_headersstrips sensitive headers before storage, andJsonCache+SqliteCache.export_json()/import_json()+--httpx-cache-format=jsonenable git-diffable test fixtures. - Streaming memory guard & SSE verification:
max_cacheable_bytesaborts buffering mid-stream without failing downloads; verified LLMtext/event-streamrecord & offline replay. - Prefix invalidation & SQLite schema versioning: added
.keys(prefix)and.delete_prefix(prefix)across all 5 stores andPRAGMA user_version = 1inSqliteCache. - RFC 9111 multi-variant
Varystorage: variants for differentVaryrequest header values coexist without overwriting each other. - Observability hooks, CLI & benchmarks: added
on_hit/on_miss/on_storecallbacks, the zero-dephttpx-cacheCLI (stats,inspect,purge,clear,export,import), and reproduciblebenchmarks/bench.py+docs/benchmarks.md.
Full Changelog: v1.1.0...v1.2.0