From 94942d9d23b6e010c95d71e18bd10a8c641bc536 Mon Sep 17 00:00:00 2001 From: shigahi Date: Thu, 19 Nov 2026 11:55:02 +0100 Subject: [PATCH 1/2] Cache hashed assets and the font in the browser 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 --- public/_headers | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/public/_headers b/public/_headers index 693f3ea..f31219c 100644 --- a/public/_headers +++ b/public/_headers @@ -3,3 +3,12 @@ X-Frame-Options: DENY Referrer-Policy: strict-origin-when-cross-origin Permissions-Policy: camera=(), microphone=(), geolocation=() + +/assets/* + Cache-Control: public, max-age=31536000, immutable + +/fonts/* + Cache-Control: public, max-age=2592000 + +https://:version.:subdomain.workers.dev/* + X-Robots-Tag: noindex From f2fad52a777a7d2ce120eeb0907a2285e4c42825 Mon Sep 17 00:00:00 2001 From: shigahi Date: Thu, 19 Nov 2026 11:55:02 +0100 Subject: [PATCH 2/2] Run the render check on the current compatibility date and a full-page 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 --- scripts/render-check.mjs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/render-check.mjs b/scripts/render-check.mjs index cd4468f..878442b 100644 --- a/scripts/render-check.mjs +++ b/scripts/render-check.mjs @@ -21,6 +21,7 @@ const SUBPAGE = "3e6558d7de17817da2dcd0227d6062e0"; const DB_ITEM = "3e6558d7de1781258e84de9616a91c0e"; const PORT = Number(process.env.PORT || 8799); const RUNS = Number(process.env.RUNS || 2); +const TODAY = new Date().toISOString().slice(0, 10); const DB_VIEWS = ["table", "board", "gallery", "list", "calendar", "timeline"]; const CRAWLER = "Mozilla/5.0 (compatible; GPTBot/1.2; +https://openai.com/gptbot)"; @@ -85,7 +86,9 @@ async function generateWorker(dir) { fs.writeFileSync(path.join(dir, "worker.js"), patched); fs.writeFileSync( path.join(dir, "wrangler.jsonc"), - JSON.stringify({ name: "worknot-render-check", main: "worker.js", compatibility_date: "2026-03-11" }), + // A Worker created in the dashboard gets the current date; wrangler falls back + // to the newest date its runtime supports + JSON.stringify({ name: "worknot-render-check", main: "worker.js", compatibility_date: TODAY }), ); } finally { await vite.close(); @@ -118,7 +121,8 @@ async function openPage(browser, target) { const context = await browser.newContext({ ignoreHTTPSErrors: true, serviceWorkers: "block", - viewport: { width: 1280, height: 1000 }, + // Notion only renders the blocks near the viewport, so fit the whole test page in it + viewport: { width: 1280, height: 6000 }, }); const failures = []; const origin = new URL(target.origin).host;