-
Notifications
You must be signed in to change notification settings - Fork 430
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
chore(ci): set a shorter cache on manifest #6660
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
This stack of pull requests is managed by Graphite. Learn more about stacking. |
No changes to documentation |
scripts/uploadBundles.ts
Outdated
@@ -160,6 +160,10 @@ async function updateManifest(newVersions: Map<string, string>) { | |||
const options = { | |||
destination: 'modules/v1/manifest-v1.json', | |||
contentType: 'application/json', | |||
metadata: { | |||
// 10 mins cache | |||
cacheControl: 'public, max-age=600', |
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.
@rexxars should this be shorter than even 10 mins?
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 got assigned because of a force push to next 😇)
note that the only way to "guarantee" fresh content is to cache break when you load the manifest file. There will most likely be at least two caches involved, client and google cdn, and they will both use this one cache header. This will lead to max cache time being between 600 and (600+600).
So if you're able to add a static hash, that's unique per build of the manifest, when the user loads the file it would reduce the cache time to whenever the cache is broken on the page that loads it.
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.
What if the manifest is only used on the server? In that case won't it just be the (600) from the 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.
Depends on how many proxies and caches are in the chain, but if it's just a http call to a gcp bucket it should only be up to 600s
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.
yep that is what it is, I'll DM you to confirm. Thanks for jumping in
Component Testing Report Updated May 22, 2024 8:38 PM (UTC)
|
Needs a rebase? |
53a2995
to
77f6990
Compare
77f6990
to
9565e3b
Compare
9565e3b
to
92df7ef
Compare
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.
👍
Description
Update the cache header on the manifest to be 10s and JS files to 1 year immutable
FIXES SDX-1343
What to review
Changes makes sense
Testing
N/A
Notes for release
N/A (internal)