diff options
Diffstat (limited to 'src/server/server_Initialization.ts')
-rw-r--r-- | src/server/server_Initialization.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/server/server_Initialization.ts b/src/server/server_Initialization.ts index 3bdc93f10..d1b9d8cf2 100644 --- a/src/server/server_Initialization.ts +++ b/src/server/server_Initialization.ts @@ -92,12 +92,12 @@ function buildWithMiddleware(server: express.Express) { passport.session(), (req: express.Request, res: express.Response, next: express.NextFunction) => { res.locals.user = req.user; - if (req.method == 'GET') { + if (req.originalUrl.endsWith(".png") && req.method === 'GET') { const period = 30000; - res.set('Cache-control', `public, max-age=${period}`) + res.set('Cache-control', `public, max-age=${period}`); } else { // for the other requests set strict no caching parameters - res.set('Cache-control', `no-store`) + res.set('Cache-control', `no-store`); } next(); } |