From 578efbd11057581541751062262214db881aa588 Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Sat, 8 Oct 2022 01:59:51 +0700 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=BE=D0=BF=D1=80=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20=D0=B7=D0=B0=D0=B3=D0=BE=D0=BB=D0=BE=D0=B2=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/index.js b/server/index.js index aed3b5c..3e2cf9a 100644 --- a/server/index.js +++ b/server/index.js @@ -194,9 +194,10 @@ function initStatic(app, config) { //заголовки при отдаче const filesDir = `${config.publicDir}/files`; app.use(express.static(config.publicDir, { - maxAge: '30d', - setHeaders: (res, filePath) => { + res.set('Cache-Control', 'no-cache'); + res.set('Expires', '-1'); + if (path.dirname(filePath) == filesDir) { res.set('Content-Encoding', 'gzip');