Cache documentation before Worker execution - #13
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Enable native Cloudflare Workers Cache before Worker execution, with deployment-isolated cache namespaces. Cache hits avoid Worker CPU and R2 reads; Cloudflare still counts them as Worker requests.
Documentation and redirects use a one-day browser TTL, 30-day edge TTL, seven-day stale-while-revalidate, and 30-day stale-if-error. Explicit revisions remain immutable for one year. Sitemaps and robots retain shorter TTLs. Accept and test the native cache behavior for HEAD with Range (206 with range metadata and no body).
Validation: 34 Worker tests and canary/production dry-runs passed. Staging deployment and the complete smoke suite passed: https://github.com/Gecode/gecode.github.io/actions/runs/36679599037. A fresh staging URL returned MISS, HIT, HIT with the one-day browser header. Earlier execution logs confirmed one execution for three requests. Short-TTL SWR and live revision rollback are not yet exercised against the native cache.
Production requires the cloudflare-production environment approval. The runbook retains Fastly as an optional outer CDN to reduce Cloudflare request counts.