Repository navigation
Let Back restore a locally served page from the page cache - #3450
Merged
Merged
Conversation
The local page server answers with `Cache-Control: no-cache` instead of `no-store`, so Chrome and Firefox keep a Leaf page in their back/forward cache and Back shows it at once. With no validator sent, every reuse is still a full fetch. leaf.page keeps `no-store`: there a visitor's private comments would otherwise stay in the browser's disk cache after their session ends. Max's decision #6 on the overnight report. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
approved these changes
Oct 21, 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.
The local page server now answers documents and API requests with
Cache-Control: no-cacheinstead ofno-store, so Chrome and Firefox keep a Leaf page in their back/forward cache. Pressing Back after following a link, such as a PR link on a page, now shows the page at once instead of loading it from scratch. leaf.page keepsno-store, including on its container's Python answers. This implements Max's decision #6 on the overnight report.no-cachelets the browser store an answer but has it check with the server before each reuse. The server sends no validator, so each reuse is a full fetch, and every load shows the page as it is now. The stored copy holds what the page directory already keeps in plain files under the same user's state home.leaf.page keeps
no-storebecause there the stored copy is new: a visitor's private comments and replies would stay in the browser's disk cache after their session ends, readable by anyone who later uses that browser profile.WebsitePageEndpointoverrides the class attribute, and a live sample's child page uses its parent's setting.Evidence
I served
release-notes(no samples) andcorpus(samples) from the merge base and from this branch, followed a link off the page, opened a thread from the CLI while the page was away, pressed Back, and waited until the page had applied a/api/stateanswer taken after that thread. Then I left again, opened another thread and loaded the URL afresh. Chromium is Playwright's full Chromium 153 with Playwright's--disable-back-forward-cacheremoved. Firefox is the installed Firefox 158.0.1 driven through geckodriver, because Playwright's Firefox disables its page cache in the docshell.no-store)no-cache)release-notes, BackMainResourceHasCacheControlNoStore,JsNetworkRequestReceivedCacheControlNoStoreResource), current after 243 mspageshow.persisted), fetched/api/state4 ms afterpageshow, current 43 ms after Backrelease-notes, Backcorpus(samples), Backcorpus, Backrelease-notes, Back with anunloadhandler (no page cache)Safari wasn't tried. The run is recorded in
notes/browser-support.md, "Page cache", and the open leaf.page half of the question stays inTODO.md.