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

chore(ci): set a shorter cache on manifest #6660

Merged
merged 2 commits into from
May 23, 2024

Conversation

binoy14
Copy link
Contributor

@binoy14 binoy14 commented May 14, 2024

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)

Copy link

vercel bot commented May 14, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
performance-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 22, 2024 8:31pm
test-next-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 22, 2024 8:31pm
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 22, 2024 8:31pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Visit Preview May 22, 2024 8:31pm

Copy link
Contributor Author

binoy14 commented May 14, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @binoy14 and the rest of your teammates on Graphite Graphite

Copy link
Contributor

No changes to documentation

@@ -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',
Copy link
Contributor Author

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?

Copy link
Member

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.

Copy link
Contributor Author

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?

Copy link
Member

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

Copy link
Contributor Author

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

@binoy14 binoy14 marked this pull request as ready for review May 14, 2024 14:10
@binoy14 binoy14 requested a review from a team as a code owner May 14, 2024 14:10
@binoy14 binoy14 requested a review from bjoerge May 14, 2024 14:10
Copy link
Contributor

github-actions bot commented May 14, 2024

Component Testing Report Updated May 22, 2024 8:38 PM (UTC)

File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 35s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 6s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ✅ Passed (Inspect) 25s 6 0 0
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 31s 11 7 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 14s 6 0 0
formBuilder/inputs/PortableText/DisableFocusAndUnset.spec.tsx ✅ Passed (Inspect) 8s 3 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 36s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 1m 16s 21 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 1m 3s 18 0 0
formBuilder/inputs/PortableText/PresenceCursors.spec.tsx ✅ Passed (Inspect) 7s 3 9 0
formBuilder/inputs/PortableText/RangeDecoration.spec.tsx ✅ Passed (Inspect) 20s 9 0 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 14s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ✅ Passed (Inspect) 30s 12 0 0

@binoy14 binoy14 requested a review from rexxars May 14, 2024 15:01
@binoy14 binoy14 requested review from a team and sjelfull and removed request for a team May 14, 2024 15:52
@bjoerge
Copy link
Member

bjoerge commented May 15, 2024

Needs a rebase?

Copy link
Member

@rexxars rexxars left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

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.

4 participants