diff --git a/packages/host/config/deploy.js b/packages/host/config/deploy.js index f166dcdec4..712e353128 100644 --- a/packages/host/config/deploy.js +++ b/packages/host/config/deploy.js @@ -37,6 +37,12 @@ module.exports = function (deployTarget) { deployTarget === 's3-preview-production' ) { ENV.s3.prefix = process.env.PR_BRANCH_NAME; + // Previews should always serve the latest build for the PR, so a reviewer + // returning later sees current state without a shift-refresh. The default + // is `max-age=63072000, public` plus a 2029 Expires, which pins assets in + // the browser for ~2 years. + ENV.s3.cacheControl = 'no-cache, max-age=0, must-revalidate'; + ENV.s3.expires = new Date(0); } return ENV;