CtrlK
BlogDocsLog inGet started
Tessl Logo

testland/cache-coherence-patterns-reference

Pure-reference catalog of cache-coherence patterns across the request path. Defines the five-tier cache stack (browser → CDN → reverse-proxy → application → data store), the per-tier cache-writing patterns (cache-aside, write-through, write-back, write-around, refresh-ahead), and the canonical invalidation strategies (TTL-only, event-driven purge, surrogate keys, version-tagged URLs, soft purge), plus an anti-pattern table and a worked multi-tenant coherence-test example. Deep detail - the RFC 9111 Cache-Control / Vary / ETag directive tables and the cross-tier coherence + per-tier test surface - lives in references/. Use for pattern selection, Cache-Control header design, and coherence audits; use a cache-key-collision check when the question is whether two requests in an existing system collide on a concrete key scheme. Consumed by redis-cache-tests, cdn-cache-purge-tests, varnish-test-vtc-syntax, browser-cache-control-tests, and the cache-key-collision check.

75

Quality

94%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide

SecuritybySnyk

Passed

No findings from the security scan

Overview
Quality
Evals
Security
Files

cross-tier-coherence-and-test-surface.mdreferences/

Cross-tier coherence problems and the per-tier test surface

Deep reference for cache-coherence-patterns-reference SKILL.md. Consult when auditing an existing multi-tier cache for coherence bugs and when deciding what to test at each tier.

Cross-tier coherence problems

A coherence bug at any tier surfaces at the user; the failure usually lives in the seam between two tiers, not inside one.

ProblemWhereDetection
Browser caches stale page after server purgeBrowser ignores must-revalidate, or no must-revalidateE2E test: write → reload → see old
CDN serves stale after origin updatePurge didn't propagate or s-maxage too longE2E: write → purge → read at CDN edge
Different Vary at browser vs CDNCDN strips headers; cache keys divergeHeader-comparison test
Layered TTL inversions-maxage < max-age → CDN refreshes more often than browser; browser eventually outpaces CDNAudit the TTL stack
Vary: Cookie without normalised cookiesTracker cookies fragment cache; near-zero hit rateInspect Vary; normalise
Tenant-scoped data with shared VaryCross-tenant leak per cross-tenant-data-leak-testsAdd Authorization to Vary or use private

Testable behaviours by tier

Each tier needs its own coherence tests; the categories below map to the per-tier test skills that consume this reference.

TierTest categories
BrowserCache-Control respected (max-age, no-cache, must-revalidate); ETag round-trip; Vary honoured
CDNEdge hit/miss vs origin; purge API works end-to-end; s-maxage overrides max-age
Reverse proxyVCL purge (varnish-test-vtc-syntax); grace-mode behaviour
ApplicationCache-aside write-then-invalidate; key collisions
Data storeReplication lag (separate concern; out of scope here)

SKILL.md

tile.json