Repository navigation
fix(pages): send Purpose: prefetch on static page-data prefetch - #1065
Closed
Brooooooklyn wants to merge 2 commits into
Closed
Brooooooklyn wants to merge 2 commits into
Brooooooklyn wants to merge 2 commits into
Conversation
Dynamic X-VoidPages prefetch already sends Purpose: prefetch, but the static /_void/pages/*.json fetch did not, both on the fast path and when the HTML answer has deferred props. Pass the purpose through loadStaticPageData and loadStaticPageDataFile so every prefetch request says so, and a visit never does. The header does not change the static file or its cache key. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When the fast-path static JSON fetch misses and the dynamic GET returns HTML, loadStaticPageData fetches the static file again. Run the HTML-first Purpose test with the fast path on too, so that retry must carry Purpose: prefetch for a prefetch and no Purpose for a visit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Cloudflare builds and deploys previews for this pull request. Learn more about Cloudflare previews.
Updated: |
Member
Author
|
Combined into #1067 (visit analytics, one PR). All commits from this PR are on that branch. |
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 dynamic page-data prefetch already sends
Purpose: prefetch. The static/_void/pages/*.jsonprefetch didn't, so the server couldn't tell it apart from a real visit. Visit analytics (coming next) needs that difference so it doesn't count hover prefetches as page views.fetchPrefetchPageDatapass'prefetch'. Visits pass nothing, and no new request is added.Vary: Purpose, so a prefetched file and a later visit still share one cache entry.engine.prefetch().Tests
packages/void/test/unit/pages-client.test.ts:The static/dynamic test now checks the header:
prefetchon a prefetch, none on a visit.A new table test covers the HTML-first path, with the fast path off and on. Removing
purpose, or forcing it on visits, each makes a case fail.Focused file: 163 passed
vp check: cleanvp run test: 200/200 tasks🤖 Generated with Claude Code