diff --git a/scripts/uploadBundles.ts b/scripts/uploadBundles.ts index 16399922a99..8172f6949f0 100644 --- a/scripts/uploadBundles.ts +++ b/scripts/uploadBundles.ts @@ -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 @@ -160,6 +164,10 @@ async function updateManifest(newVersions: Map) { 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)