From 6011de49a01994ccae2955c4b4d33236c3388776 Mon Sep 17 00:00:00 2001 From: Jori Lallo Date: Sun, 5 Jun 2016 21:39:09 -0700 Subject: [PATCH] Smarter cache headers --- server/routes.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/server/routes.js b/server/routes.js index da5f5b018..706b2343a 100644 --- a/server/routes.js +++ b/server/routes.js @@ -28,16 +28,15 @@ if (process.env.NODE_ENV === 'production') { router.get('/static/*', async (ctx) => { ctx.set({ - 'Cache-Control': 'max-age=999999999999', + 'Cache-Control': `max-age=${356*24*60*60}`, }); const stats = await sendfile(ctx, path.join(__dirname, '../dist/', ctx.path.substring(8))); }); router.get('*', async (ctx) => { - // Cache forever ctx.set({ - 'Cache-Control': 'max-age=999999999999', + 'Cache-Control': `max-age=${24*60*60}`, }); const stats = await sendfile(ctx, path.join(__dirname, '../dist/index.html'));