Repository navigation
fix: serve mutable docs HTML directly from R2 - #144
Merged
Merged
Conversation
hannesrudolph
marked this pull request as ready for review
August 30, 2026 23:34
This was referenced Aug 31, 2026
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.
What Problem This Solves
Fixes an issue where a changed docs page can remain stale at its canonical URL after a successful R2 deployment. The v2026.8.1 Markdown endpoint and cache-busted HTML returned the current page, while the normal HTML URL continued returning an older
caches.defaultentry with immutable cache headers.Why This Change Was Made
Mutable HTML and slashless HTML aliases now bypass the Worker Cache API and read directly from the native R2 binding. Static assets, Markdown, and other non-HTML responses keep Worker caching. The minute-suffixed HTML cache key and the unusable purge workflow are removed; the protected token could resolve the zone but Cloudflare rejected purge with
401 Authentication errorbecause it lacks Cache Purge permission.This follows Cloudflare’s documented boundary that URL purge cannot invalidate Cache API entries whose custom key was set by a Worker. It restores freshness without requiring broader Cloudflare access, tag infrastructure, or a zone-wide purge.
User Impact
Updated documentation becomes visible at its stable HTML URL as soon as the R2 object changes. Maintainers no longer need personal Cloudflare dashboard access or a separate cache-purge credential to publish a corrected page.
Evidence
X-OpenClaw-Docs-Cache: HITnpm test— 48/48 tests passednpx [email protected] deploy --dry-run --config wrangler.toml— passedmake docs-checknpm run docs:visual— passed