diff options
author | bobzel <zzzman@gmail.com> | 2022-02-22 14:00:29 -0500 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2022-02-22 14:00:29 -0500 |
commit | 3e728c21ba578843ebd25294f336f0bf6601b75f (patch) | |
tree | f35d4538c2c11139967a6f6952a09e1161d14e79 /src/server/server_Initialization.ts | |
parent | a069560e3dd6fa4acf413409d56c5fbb6e9f8808 (diff) |
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.
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(); } |