v2.0.0
Major Changes
-
4b5004c: Fix cache key safety, HTTP semantics, and Vary handling:
- Reduce wrong cache hits from digest collisions — cookie/header/device values are hashed with a single standard SHA-1 digest over a canonical string, instead of per-value truncated digests that could collide at scale.
- Stop
httpandhttpsfrom sharing the same entry — URL scheme is included in default keys so representations are not mixed across schemes (RFC 9111 URI identity). - Make Vary-aware keys unambiguous — use explicit
|v|/|vary|suffixes so base keys, Vary metadata, and variants cannot be parsed incorrectly. - Keep keys debuggable without exposing secrets — fragment key names stay visible (
#cookie:a|header:x-id@…); only normalized values are digested. - Align cache lookup options with Workers Cache API —
match()/delete()supportignoreMethodonly; ignore query strings viacacheKeyRules.search: false, and bypass Vary viasharedCache.ignoreVary.
Breaking: Existing cache entries miss until they expire or are revalidated. Set
scheme: falseto keep the previous host-first URL shape. RemovecacheKeyPartDefiners/SharedCacheKeyPartDefiners; use built-incacheKeyRulesonly.
Minor Changes
-
6f8b479: Simplify the package internals with no intended behavior change for supported public APIs.
Breaking: Deprecated logger helpers are removed. Use
createLogger(logger, level, 'SharedCache')instead ofcreateSharedCacheLogger(logger, level).Breaking: Rename public types for consistent naming:
SharedCacheKeyRules→CacheKeyRules,FilterOptions→KeyFilterOptions,SharedCacheLogContext→CacheLogContext,SharedCacheStatus→CacheStatus.