From f6dd291bf3dab6d39135258f97d772d5cbcb181d Mon Sep 17 00:00:00 2001 From: Andrey Gorbunov Date: Tue, 10 Dec 2024 18:23:25 +0100 Subject: [PATCH 1/2] Refs #33613: OPTIONS requests response - allow browser to cache for 24 hours --- src/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index abc85965..2a53484e 100755 --- a/src/index.ts +++ b/src/index.ts @@ -44,7 +44,8 @@ app.use('/media', express.static(path.join(__dirname, config.get(`${config.get(' // 3rd party middleware app.use(cors({ - exposedHeaders: config.get('corsHeaders') + exposedHeaders: config.get('corsHeaders'), + maxAge: 86400 })); app.use(bodyParser.json({ From 6381ba8059a9aceecf8e3c1cc00a975c4758a4f8 Mon Sep 17 00:00:00 2001 From: Andrey Gorbunov Date: Tue, 10 Dec 2024 18:24:27 +0100 Subject: [PATCH 2/2] Refs #33613: Enable responses compression --- src/index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/index.ts b/src/index.ts index 2a53484e..ed8dc2b8 100755 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,5 @@ import express from 'express'; +import compression from 'compression'; import cors from 'cors'; import morgan from 'morgan'; import bodyParser from 'body-parser'; @@ -18,6 +19,7 @@ import * as path from 'path' const app = express(); app.enable('trust proxy'); +app.use(compression()); const httpLogFormat = process.env.LOG_HTTP_FORMAT || 'dev'