Поправил заголовки
This commit is contained in:
@@ -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');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user