Repository navigation
Cache hashed assets and keep the render check current - #204
Merged
Merged
Conversation
Workers serves static assets with max-age=0, must-revalidate, so every repeat visit revalidated the 567 kB script, the stylesheet and the preloaded font. Vite content-hashes the files in /assets/, so cache them for a year as immutable. The font keeps its URL, so cache it for 30 days. Also send X-Robots-Tag: noindex on workers.dev hosts (the production workers.dev URL and the version preview URLs), so that only worknot.classmethod.live is indexed. Co-Authored-By: Claude Fable 5.2 <[email protected]>
…e viewport A Worker created in the dashboard gets the current compatibility date, but the check ran the generated worker on 2026-03-11. Use today's date, so that the daily check covers the runtime new users get, such as nodejs_compat being on by default since 2026-08-04. Notion now only renders the blocks near the viewport. With a 1000px viewport the database views, the rows and the subpage link were missing, on notion.site as well, so those checks reported NOTION, or FAIL when only the notion.site session got the whole page. Use a viewport taller than the test page. Co-Authored-By: Claude Fable 5.2 <[email protected]>
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.
Summary
Findings from a review against the updated Cloudflare skills (Workers best practices, Wrangler, web performance).
src/code.tsis unchanged, so generated scripts stay the same.Site (
public/_headers)/assets/*for a year asimmutable. Workers serves static assets withmax-age=0, must-revalidateby default, so every repeat visit revalidated the 567 kB script, the stylesheet and the preloaded font (five304responses per page view on production). Vite content-hashes these files, and this is the rule the static assets docs recommend./fonts/*for 30 days. The font keeps its URL, so it is not marked immutable.X-Robots-Tag: noindexon*.*.workers.dev. The site is also reachable on its workers.dev URL and on every version preview URL.The rules also apply to 404 responses: a request for a missing file under
/assets/gets the one-year header too. This is only reachable while a deployment propagates, and the next build changes the file name.Render check (
scripts/render-check.mjs)nodejs_compat, on by default since 2026-08-04). Wrangler falls back to the newest date its runtime supports.NOTIONfor weeks, andFAILwhen only the notion.site session happened to get the whole page.Not changed:
wrangler.jsonc: the site Worker has no script, so traces and a newer compatibility date would have no effect./api/*request bodies to rewrite them. A size limit would not stop a flood of smaller requests, so this is left to Cloudflare rate limiting rules.Verification
npm test: 26 tests pass.npm run buildpasses.wrangler devon the build:/assets/*.jsand/assets/*.cssreturnmax-age=31536000, immutable, the fontmax-age=2592000, HTML and other files the default.X-Robots-Tagis only sent when theHostis a workers.dev name, not forworknot.classmethod.live.npm run check:renderagainst live Notion: every check passes on both targets (embeds are skipped, as before). On master the same run reportedFAILfor database views and navigation.After merge