From e37f1526ecc2a16edc22da748126b8a68371adbc Mon Sep 17 00:00:00 2001 From: Henri Bergius Date: Wed, 26 Dec 2018 13:33:35 +0100 Subject: [PATCH] Allow video caching indefinitely --- server/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/index.js b/server/index.js index c6bd3b9..a4fa4e4 100644 --- a/server/index.js +++ b/server/index.js @@ -17,7 +17,11 @@ app .use(router.routes()) .use(router.allowedMethods()) .use(Static(path.resolve(__dirname, '../dist'), {})) - .use(Mount('/videos', Static(path.resolve(__dirname, '../videos'), {}))); + .use(Mount('/videos', Static(path.resolve(__dirname, '../videos'), { + setHeaders: (res) => { + res.setHeader('cache-control', 'immutable'); + }, + }))); module.exports = app; if (!module.parent) {