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

perf: shorten file names #13003

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

perf: shorten file names #13003

wants to merge 3 commits into from

Conversation

benmccann
Copy link
Member

@benmccann benmccann commented Nov 15, 2024

This shortens references to JS files in SSR, JS, and HTTP headers. Less bytes referring to these files. Also, the chunks often pick combine multiple files and pick the name of one individual file to use for the chunk, which can be misleading

Reducing the size of asset names reduced the size of the JS on my image-heavy page by 6.5% after brotli compression, but we couldn't come to agreement to shorten those

Copy link

changeset-bot bot commented Nov 15, 2024

🦋 Changeset detected

Latest commit: 2e91dab

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

This PR includes changesets to release 1 package
Name Type
@sveltejs/kit 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

@Rich-Harris
Copy link
Member

preview: https://svelte-dev-git-preview-kit-13003-svelte.vercel.app/

this is an automated message

@benmccann benmccann force-pushed the short-names branch 3 times, most recently from ff34d60 to 54a6836 Compare November 15, 2024 00:38
@dominikg
Copy link
Member

this could be a breaking change.it's going to bust existing users caches due to the change in output names, and if they used those somewhere without resolution through manifest, those references break too.

@benmccann
Copy link
Member Author

it's going to bust existing users caches due to the change in output names

it wouldn't be the first time we've changed it and no one's ever complained before. static assets are incredibly cheap to serve

if they used those somewhere without resolution through manifest, those references break too

the filenames already change everytime a single character changes and I don't know what you can do referencing an individual file anyway

@dominikg
Copy link
Member

assets don't change that often. this will force all users to download everything again they already had far future cached. images, fonts, everything...

how often did we change it? if we offer immutable asset caching as a feature, we should be mindful not to bust that

@benmccann
Copy link
Member Author

Yeah, we've changed it very rarely

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.

3 participants