From 28fafffef3ef7cbc3988980e842c7e8c0f8349b8 Mon Sep 17 00:00:00 2001 From: Jakob Ackermann Date: Wed, 16 Jun 2021 10:15:28 +0200 Subject: [PATCH] Merge pull request #4209 from overleaf/jpa-service-worker-24h-cache [Server] lower the cache duration for the service worker to 24h GitOrigin-RevId: b67b030722812a30d7c2fc98f9183538307f9a1a --- services/web/app/src/infrastructure/Server.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/services/web/app/src/infrastructure/Server.js b/services/web/app/src/infrastructure/Server.js index eec9a316eb..6005494e2c 100644 --- a/services/web/app/src/infrastructure/Server.js +++ b/services/web/app/src/infrastructure/Server.js @@ -81,6 +81,12 @@ if (Settings.exposeHostname) { }) } +webRouter.get( + '/serviceWorker.js', + express.static(Path.join(__dirname, '/../../../public'), { + maxAge: oneDayInMilliseconds, + }) +) webRouter.use( express.static(Path.join(__dirname, '/../../../public'), { maxAge: STATIC_CACHE_AGE,