Skip to content

Commit

Permalink
chore(ci): set a shorter cache on manifest (#6660)
Browse files Browse the repository at this point in the history
* chore(ci): set a shorter cache on manifest

* chore: update cache on JS files and manifest
  • Loading branch information
binoy14 committed May 23, 2024
1 parent 6ba71f2 commit 069dd31
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions scripts/uploadBundles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ async function copyPackages() {
destination: `modules/${appVersion}/${cleanDir}/${version}/bare/${fileName}`,
gzip: true,
contentType: 'application/javascript',
metadata: {
// 1 year cache
cacheControl: 'public, max-age=31536000, immutable',
},
}

// Upload files to the proper bucket destination
Expand Down Expand Up @@ -160,6 +164,10 @@ async function updateManifest(newVersions: Map<string, string>) {
const options = {
destination: 'modules/v1/manifest-v1.json',
contentType: 'application/json',
metadata: {
// 10 seconds
cacheControl: 'public, max-age=10',
},
}

await bucket.upload('manifest-v1.json', options)
Expand Down

0 comments on commit 069dd31

Please sign in to comment.