pass max-age header on js bundle so cloudflare can cache it

This commit is contained in:
Sean Yesmunt 2020-10-23 01:50:18 -04:00
parent 221ae5b821
commit 8c43457622

View file

@ -23,7 +23,7 @@ async function redirectMiddleware(ctx, next) {
request: { url },
} = ctx;
if (STATIC_ASSET_PATHS.includes(url)) {
if (STATIC_ASSET_PATHS.includes(url) || (url.startsWith('/public/ui-') && url.endsWith('.js'))) {
ctx.set('Cache-Control', `public, max-age=${SIX_MONTHS_IN_SECONDS}`);
}