From 3e728c21ba578843ebd25294f336f0bf6601b75f Mon Sep 17 00:00:00 2001 From: bobzel Date: Tue, 22 Feb 2022 14:00:29 -0500 Subject: fixed switching tabs to immediately render the title of the tab as content to provide feedback that something is happening. changed server to only set caching for images. fixed warnings/errors. --- src/server/server_Initialization.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/server') 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(); } -- cgit v1.2.3-70-g09d2