Releases: kemalcr/kemal-cache
Releases · kemalcr/kemal-cache
v1.2.0
- Added fail-open handler behavior for store
get,set, and corrupt-payloaddeleteerrors so cache backend failures do not break otherwise successful requests. - Added observable
StoreErrorevents andstats.store_errorscounters for cache backend failures. - Added non-raising
try_invalidateandtry_clear_cachehelpers for operational cache management. - Added
Config#ttl_resolverfor per-route and per-cache-key TTL selection, withnilfalling back toexpires_in. - Added optional
Config#max_ttlto clamp resolved and fallback TTL values to a configured upper bound. - Added opt-in, process-local cache stampede protection via
collapse_concurrent_misses. - Added fail-fast validation to reject non-positive
expires_invalues. - Added validation to reject zero and negative resolved TTL values.
- Added validation to reject non-positive
max_ttlvalues.
v1.1.0
- Made Redis support opt-in via
require "kemal-cache/redis"so the core middleware can be used without a runtime Redis dependency. - Switched
RedisStore#clearfromKEYSto cursor-basedSCANiteration. - Invalidates corrupt cached payloads and falls back to a cache miss instead of failing the request.
- Added an optional
MemoryStoreentry cap with oldest-entry eviction. - Added a distinct
disabledbypass reason and clarified stats semantics for cacheable requests and304 Not Modifiedhits. - Preserves headers set before the cache handler on cache hits unless the cached response replaces that header name.
v1.0.0
Initial stable release of kemal-cache.
- Production-ready response caching middleware for Kemal.
- Safe-by-default cache behavior for authenticated, cookie-bearing, and non-cacheable responses.
- Successful
2xxresponses cached by default. MemoryStoreas the default in-process backend.- Built-in
RedisStorebacked byjgaskins/redis. - Configurable cache keys with
key_generator. - Configurable cache methods and status-code policies.
- Request and response filters with
skip_ifandshould_cache. - Cache invalidation APIs with
invalidate(key),invalidate(context), andclear_cache. - Response size guards with
max_body_bytes. - Streaming guards with
cache_streaming. - Automatic
ETagandLast-Modifiedgeneration for cached responses. - Conditional GET support with
If-None-Match,If-Modified-Since, and304 Not Modified. - Built-in observability with
Stats,Event,EventType, andon_event.