Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

breaking: precompress by default #11945

Merged
merged 1 commit into from
Mar 8, 2024
Merged

breaking: precompress by default #11945

merged 1 commit into from
Mar 8, 2024

Conversation

benmccann
Copy link
Member

I'd like to merge this together with #11653 where we're already doing a major version bump in adapter-node.

I was looking at a major SvelteKit project and they were just using the default options and not precompressing assets, which would have made their site much faster. It made me wonder why we weren't doing it by default as I believe we should have our defaults align with making sites fast. This feature was originally introduced in #1693. It was made false by default there as they were worried about adding to build time. I tried building the site with both true and false and there was minimal if any difference in speed, so I don't think we should let that block us

Should we just remove the option and always do it by default? I don't really see why you'd want to be able to disable it. There are potentially other options you'd want to be able to set though (#10789). Removing the option would free up space for new options. Or perhaps we should make it precompress.enabled as another way of freeing up the namespace

Copy link

changeset-bot bot commented Mar 6, 2024

🦋 Changeset detected

Latest commit: 0377ad4

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

This PR includes changesets to release 1 package
Name Type
@sveltejs/adapter-node Major

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

@eltigerchino
Copy link
Member

How does precompress work with reverse proxies like nginx that might also precompress? Having a reverse proxy was something we recommended for adapter-node in past issues.

@benmccann
Copy link
Member Author

It sounds to me like it handles it just fine. It says it:

does not “double compress” responses that are already compressed

https://docs.nginx.com/nginx/admin-guide/web-server/compression/

@eltigerchino
Copy link
Member

Sounds like it's fine leaving it on by default then? But I'm not well versed with node servers and nginx. I think @Conduitry and @gtm-nayan might know more.

@benmccann benmccann merged commit 3f0526c into main Mar 8, 2024
13 checks passed
@benmccann benmccann deleted the precompress-true branch March 8, 2024 16:59
@github-actions github-actions bot mentioned this pull request Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants