Skip to content

Root baseof: drop caching of scripts.html - #2787

Merged
chalin merged 2 commits into
google:mainfrom
chalin:chalin-m24-partial-cached-fix-2026-0902
Sep 2, 2026
Merged

Root baseof: drop caching of scripts.html#2787
chalin merged 2 commits into
google:mainfrom
chalin:chalin-m24-partial-cached-fix-2026-0902

Conversation

@chalin

@chalin chalin commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator
  • Why: partialCached "scripts.html" . with no variant key assumes page-invariant output, but the Store-gated script emission (mermaid, katex) made the output page-dependent: the cache serves the first-rendered page's script set to every page. The docs, blog, and swagger baseofs already call plain partial; the root baseof carried the last cached call.
  • Change: revert to plain partial. The optimization buys little (the partial is a few conditionals and script elements) and cannot be safe without a discriminating cache variant.
  • Demonstration, via a throwaway fixture site (one mermaid page among plain root-baseof pages, not committed): on main, the first-rendered page's script set was served site-wide; with the change, each page ships only what its own flags gate. Full repo test suite green.
  • Site overrides: an override of the root baseof.html keeps the cached call in its copy; candidate for the 0.18.0 upgrade post's override-review callouts.

- partialCached with no variant caches the first execution site-wide, so Store-gated scripts (mermaid, katex) keyed off whichever page rendered first; the root baseof was the only caller still cached (docs/blog/swagger baseofs use plain partial)
- Pins the fix with a fixture test: one mermaid page among plain root-baseof siblings (red before the fix)
@chalin chalin added this to the 0.18.0 milestone Sep 2, 2026
@chalin chalin changed the title Fix per-page script gating: uncache the root baseof's scripts.html Root baseof: drop caching of scripts.html Sep 2, 2026
@chalin
chalin marked this pull request as ready for review September 2, 2026 11:52
@chalin
chalin merged commit 64f51c5 into google:main Sep 2, 2026
18 checks passed
@chalin
chalin deleted the chalin-m24-partial-cached-fix-2026-0902 branch September 2, 2026 11:52
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.

1 participant