Skip to content

docs(web): note browser_ttl: respect_origin in Cache Rule#13

Merged
caio-pizzol merged 1 commit into
mainfrom
caio-pizzol/cache-rule-browser-ttl-docs
May 19, 2026
Merged

docs(web): note browser_ttl: respect_origin in Cache Rule#13
caio-pizzol merged 1 commit into
mainfrom
caio-pizzol/cache-rule-browser-ttl-docs

Conversation

@caio-pizzol

Copy link
Copy Markdown
Contributor

Documentation-only follow-up to PR #12.

After #12 deployed, live `Cache-Control` on HTML pages was `max-age=14400, stale-while-revalidate=3600` instead of the documented `max-age=300, ...`. Root cause: Cloudflare's zone-level Browser Cache TTL default (4hr) overrode origin's lower `max-age=300`. Edge caching worked correctly (origin Cache-Control was honored for edge TTL); only the browser TTL was being inflated.

Fix was a one-line addition to the existing Cache Rule (rule `b85abcfdb1fa4d07a160e88f7cc4fafd`, ruleset `bec0ea98e0444bcaaf518d626b4c47e2`): `browser_ttl.mode: respect_origin`. Verified live before this commit:

  • `/dataset` now returns `Cache-Control: public, max-age=300, stale-while-revalidate=3600` (was 14400)
  • `/favicon.ico` still returns `max-age=14400` (zone default; correct for static asset)
  • `/documents/.docx` still returns `max-age=14400` + `x-robots-tag: noindex` (both correct; content-addressed file legitimately wants 4hr browser cache)

This PR is just the README catching up — the rule fix is already live.

After PR #12 deployed, live Cache-Control returned max-age=14400 from
Cloudflare's zone-level Browser Cache TTL default, overriding origin
max-age=300. Patched the existing rule (id b85abcfdb1fa4d07a160e88f7cc4fafd)
via API to add browser_ttl.mode: respect_origin. Live now serves origin
max-age on HTML/metadata paths while keeping the 4-hour zone default for
static assets and content-addressed raw files where it's actually desired.

This commit keeps the README accurate; the Cloudflare rule itself was
updated out-of-band via API.
@codecov

codecov Bot commented May 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@caio-pizzol caio-pizzol merged commit f6d577b into main May 19, 2026
2 checks passed
@caio-pizzol caio-pizzol deleted the caio-pizzol/cache-rule-browser-ttl-docs branch May 19, 2026 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants