-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Only serve _app/immutable
with immutable cache headers
#5051
Conversation
🦋 Changeset detectedLatest commit: 257d2fd The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 packages
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 |
Previous |
Having It should be possible to just purge your CDN cache, though? |
Yes, but i was thinking about users that already downloaded the |
For users it's not an issue — the request is issued with a |
Yes, you're right! At least in Chrome, its works today, without a CDN. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you'll also need to update this line:
kit/packages/adapter-netlify/index.js
Line 67 in 4592b76
`\n\n/${builder.config.kit.appDir}/*\n cache-control: public\n cache-control: immutable\n cache-control: max-age=31536000\n` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if build
is the best name for this new directory because it seems like it'll be weird to have build/_app/build
. How about immutable
? That would also hopefully help in keeping anyone from accidentally sticking a mutable file there
Yeah, I like |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm. though I mainly reviewed the netlify and node adapters since I'm most familiar with them. might be good to get eyes on the cloudflare adapters as well
_app/build
with immutable cache headers_app/immutable
with immutable cache headers
I took another run at the cloudflare adapters and noticed a bug — now fixed |
Rather than serving everything under
/_app
with animmutable
cache header (including/_app/version.json
, which is definitely not immutable), this moves immutable assets into/_app/build
so they can easily be given separate treatment.Fixes #4837.
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm test
and lint the project withpnpm lint
andpnpm check
Changesets
pnpm changeset
and following the prompts. All changesets should bepatch
until SvelteKit 1.0