Skip to content

[Workers] Correct and expand Workers Caching docs#31149

Open
zaidoon1 wants to merge 2 commits into
cloudflare:dlapid/workersCachefrom
zaidoon1:dlapid/workersCache
Open

[Workers] Correct and expand Workers Caching docs#31149
zaidoon1 wants to merge 2 commits into
cloudflare:dlapid/workersCachefrom
zaidoon1:dlapid/workersCache

Conversation

@zaidoon1
Copy link
Copy Markdown

Round of corrections and additions based on review against pingora-origin and edgeworker cache-handler source.

Corrections:

  • Responses with no Cache-Control are cached by default via RFC 9111 heuristic freshness; the docs previously said the opposite. Add a table of the 10 default-cacheable status codes and their TTLs.
  • s-maxage, must-revalidate, and proxy-revalidate disable both stale-while-revalidate and stale-if-error, not just s-maxage with SWR.
  • no-cache caches with zero freshness rather than bypassing. Document the EXPIRED, REVALIDATED, and UPDATING outcomes precisely.
  • x-forwarded-scheme rule was reworded incorrectly; restored.

Additions:

  • stale-if-error section, including the default (infinite) and the carve-out for s-maxage / must-revalidate / proxy-revalidate.
  • 520-526 and 206 are never cached, even with explicit Cache-Control.
  • Cache Deception Armor activation conditions for the heuristic- freshness path.
  • GET and HEAD share a single cache entry; HEAD on a cold cache is converted to GET internally.
  • Custom RPC methods and WebSocket upgrades bypass the cache.
  • Cloudflare-Workers-Version-Key request header is part of the cache key.
  • Cache-Tag character set (printable ASCII), 1024 chars per tag, 1000 tags per response, case-insensitive purge matching, silent drop of invalid tags.
  • Standardized the Cf-Cache-Status value list across files.
  • tags and pathPrefixes can be combined in a single purge() call.
  • Cf-Cache-Status: STALE debugging section.

Summary

Screenshots (optional)

Documentation checklist

  • Is there a changelog entry (guidelines)? If you don't add one for something awesome and new (however small) — how will our customers find out? Changelogs are automatically posted to RSS feeds, the Discord, and X.
  • The change adheres to the documentation style guide.
  • If a larger change - such as adding a new page- an issue has been opened in relation to any incorrect or out of date information that this PR fixes.
  • Files which have changed name or location have been allocated redirects.

Round of corrections and additions based on review against pingora-origin
and edgeworker cache-handler source.

Corrections:

- Responses with no Cache-Control are cached by default via RFC 9111
  heuristic freshness; the docs previously said the opposite. Add a
  table of the 10 default-cacheable status codes and their TTLs.
- s-maxage, must-revalidate, and proxy-revalidate disable both
  stale-while-revalidate and stale-if-error, not just s-maxage with SWR.
- no-cache caches with zero freshness rather than bypassing. Document
  the EXPIRED, REVALIDATED, and UPDATING outcomes precisely.
- x-forwarded-scheme rule was reworded incorrectly; restored.

Additions:

- Request collapsing section with the 20s cache lock.
- stale-if-error section, including the default (infinite) and the
  carve-out for s-maxage / must-revalidate / proxy-revalidate.
- 520-526 and 206 are never cached, even with explicit Cache-Control.
- Cache Deception Armor activation conditions for the heuristic-
  freshness path.
- GET and HEAD share a single cache entry; HEAD on a cold cache is
  converted to GET internally.
- Custom RPC methods and WebSocket upgrades bypass the cache.
- Cloudflare-Workers-Version-Key request header is part of the cache key.
- Cache-Tag character set (printable ASCII), 1024 chars per tag,
  1000 tags per response, case-insensitive purge matching, silent
  drop of invalid tags.
- Standardized the Cf-Cache-Status value list across files.
- tags and pathPrefixes can be combined in a single purge() call.
- Cf-Cache-Status: STALE debugging section.
@github-actions github-actions Bot added the product:workers Related to Workers product label May 30, 2026
@cloudflare-docs-bot
Copy link
Copy Markdown

cloudflare-docs-bot Bot commented May 30, 2026

Review

✅ No style-guide issues found in commit 6245639.

Commands

Only codeowners can run commands. Post a comment with the command to trigger it.

Command Description
/review Runs a review now. Incremental if a prior review exists, full if not.
/full-review Re-reviews the entire PR diff from scratch, ignoring incremental history. Useful after a rebase, when you want a fresh review, or if the bot gets out of sync and reports issues that no longer exist.

Address style guide warnings from the cloudflare-docs-bot review on
PR cloudflare#31149:

- Replace directional words ('table below', 'listed above') with
  direct references.
- Replace 'doesn't' with 'does not'.
- Replace 'see [link]' with 'refer to [link]' in newly added text.
- Remove 'Note that' filler.
- Break a semicolon-joined sentence into two.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product:workers Related to Workers product size/m

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants