From 8c434576220c9e8d8d6742400977591dccd3c0b5 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Fri, 23 Oct 2020 01:50:18 -0400 Subject: [PATCH] pass max-age header on js bundle so cloudflare can cache it --- web/middleware/cache-control.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/middleware/cache-control.js b/web/middleware/cache-control.js index c6bb7d809..7e3d76f33 100644 --- a/web/middleware/cache-control.js +++ b/web/middleware/cache-control.js @@ -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}`); }