feat: ETags, immutable caching, and the data-version stamp #136
No reviewers
Labels
No labels
area: api
area: auth
area: build
area: cache
area: ci
area: compare
area: model
area: provenance
area: rite
backport
blocked
breaking
confirmed
dependencies
duplicate
epic
invalid
needs-info
needs-triage
php
priority: high
priority: low
priority: medium
regression
type: chore
type: correction
type: docs
type: enhancement
type: feature
type: fix
type: perf
type: refactor
type: security
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Directorium/Api!136
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feature/17-caching-etags"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Makes every cacheable response revalidatable and edge-friendly (epic #17) — the caching contract the Cloudflare tier depends on for the R2 deployment.
What's here
Cache\CacheHeaders(#18) — a strong ETag derived fromsha256(dataVersion|key)(changes exactly when content would, without hashing the possibly-large body), an immutableCache-Control(public, max-age=3600, s-maxage=604800, immutable), and conditional-GET handling — a client holding the current ETag gets a bodiless 304.ResponseCachenow short-circuits 304s before touching the store and stamps ETag +Cache-Control+x-cacheon hits and misses alike./v1/metais cacheable the same way;/v1/healthisno-store.X-Data-Versionon every response (successes, errors, 304s), so any client or proxy reads which build produced it without parsing the body.docs/deploy/cloudflare.md(#20) — the cache-everything rule, the query-string-in-cache-key requirement (so?calendar=sspxnever collides with universal), the origin headers table, and the purge-on-version-bump flow. Live edge rules + the purge token stay maintainer config.Verification
composer checkgreen: phpcs, PHPStan[OK], PHPUnit 68 tests / 230 assertions./v1/day→ETag,Cache-Control: …immutable,X-Data-Version,X-Cache: MISS;If-None-Match→ 304;/v1/health→no-store.Refs #17 #18 #19 #20