Skip to content

fix: don't send Vary: Accept-Encoding for assets that were never precompressed - #16566

Merged
Rich-Harris merged 9 commits into
sveltejs:version-3from
Nic-Polumeyv:manifest-precompress-variants
Jul 30, 2026
Merged

fix: don't send Vary: Accept-Encoding for assets that were never precompressed#16566
Rich-Harris merged 9 commits into
sveltejs:version-3from
Nic-Polumeyv:manifest-precompress-variants

Conversation

@Nic-Polumeyv

@Nic-Polumeyv Nic-Polumeyv commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

The remaining half of #10343, and the first concrete piece of #16565.

#15182 stopped the header when precompress is false. It still goes out on every asset when precompress is true, because sirv sets Vary from its options rather than from the file, while builder.compress only compresses a fixed extension list. So a .ico or a .png advertises a variant that was never produced.

Only extensions that were written but never compressed lose the header, since setHeaders sees the request pathname, not the file sirv resolved, and / or /v1.0 may be serving index.html.gz.

Commits are separated by layer so the kit-side and adapter-side changes can be reviewed apart.

This rewrites the same setHeaders block as #16564, so whichever lands first, the other needs a rebase.

@pkg-svelte-dev

pkg-svelte-dev Bot commented Jul 29, 2026

Copy link
Copy Markdown

Install the latest version of @sveltejs/kit from afccee5:

pnpm add https://pkg.svelte.dev/@sveltejs/kit/c/afccee5e3bfcc6ca44185e13d989ac756367a911

Open in pkg.svelte.dev: https://pkg.svelte.dev/repos/kit/pr/16566

Note

This PR is from a fork. A maintainer must approve approve each commit before it can be built and installed.

@changeset-bot

changeset-bot Bot commented Jul 29, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: afccee5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@sveltejs/kit Minor
@sveltejs/adapter-node Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@Nic-Polumeyv
Nic-Polumeyv marked this pull request as ready for review July 29, 2026 22:00
@Rich-Harris
Rich-Harris merged commit b325afb into sveltejs:version-3 Jul 30, 2026
21 of 22 checks passed
@Nic-Polumeyv
Nic-Polumeyv deleted the manifest-precompress-variants branch July 30, 2026 22:53
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