Skip to content

fix(pages): add Vary header to negotiated HTML responses - #723

Merged
cpojer merged 1 commit into
voidzero-dev:mainfrom
niteshseram:fix/pages-vary-header
Nov 5, 2026
Merged

cpojer merged 1 commit into
voidzero-dev:mainfrom
niteshseram:fix/pages-vary-header

Conversation

@niteshseram

Copy link
Copy Markdown
Contributor

In-app navigation can trigger a full page reload when a shared cache returns HTML instead of page data.

For example, opening /blog directly returns HTML. Following an in-app link to /blog requests the same URL with X-VoidPages: true, expecting JSON. If a cache returns the earlier HTML response, Void falls back to a full page load.

Cause

HTML responses were missing Vary: X-VoidPages, which tells caches that requests with and without this header receive different responses.

JSON and streamed NDJSON responses already included it, but HTML and streamed HTML did not.

Fix

Move the existing Vary handling to a shared location so all four response formats include the header. Also cover pages rendered after an action.

Preserve existing Vary values without adding duplicates, and respect Vary: *. Island pages remain unchanged because they always return HTML.

@cpojer cpojer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix!

@cpojer
cpojer merged commit 7387e32 into voidzero-dev:main Nov 5, 2026
2 checks passed
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.

2 participants