mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-13 03:40:48 +00:00
UBERF-6300: Not cache for index.html's (#5159)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
parent
1e4978cfb8
commit
916c79c96c
@ -31,7 +31,7 @@ import { v4 as uuid } from 'uuid'
|
||||
import { preConditions } from './utils'
|
||||
|
||||
const cacheControlValue = 'public, max-age=365d'
|
||||
const cacheControlNoCache = 'max-age=1d, no-cache, must-revalidate'
|
||||
const cacheControlNoCache = 'public, no-store, no-cache, must-revalidate, max-age=0'
|
||||
|
||||
async function minioUpload (
|
||||
ctx: MeasureContext,
|
||||
@ -316,10 +316,17 @@ export function start (
|
||||
app.use(
|
||||
expressStaticGzip(dist, {
|
||||
serveStatic: {
|
||||
cacheControl: true,
|
||||
dotfiles: 'allow',
|
||||
maxAge: '365d',
|
||||
etag: true,
|
||||
lastModified: true,
|
||||
index: false
|
||||
index: false,
|
||||
setHeaders (res, path) {
|
||||
if (path.toLowerCase().includes('index.html')) {
|
||||
res.setHeader('Cache-Control', cacheControlNoCache)
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user