From 9cad1c5173d6da6e329fc2d09ea086fa54834148 Mon Sep 17 00:00:00 2001 From: Jori Lallo Date: Fri, 27 May 2016 00:23:16 -0700 Subject: [PATCH] Cache static assets --- server/routes.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server/routes.js b/server/routes.js index 31d9b3711..53ab80ca3 100644 --- a/server/routes.js +++ b/server/routes.js @@ -32,6 +32,11 @@ if (process.env.NODE_ENV === 'production') { }); router.get('*', async (ctx) => { + // Cache forever + ctx.set({ + 'Cache-Control': 'max-age=999999999999', + }); + const stats = await sendfile(ctx, path.join(__dirname, '../dist/index.html')); if (!ctx.status) ctx.throw(httpErrors.NotFound()); });