mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-14 04:08:19 +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'
|
import { preConditions } from './utils'
|
||||||
|
|
||||||
const cacheControlValue = 'public, max-age=365d'
|
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 (
|
async function minioUpload (
|
||||||
ctx: MeasureContext,
|
ctx: MeasureContext,
|
||||||
@ -316,10 +316,17 @@ export function start (
|
|||||||
app.use(
|
app.use(
|
||||||
expressStaticGzip(dist, {
|
expressStaticGzip(dist, {
|
||||||
serveStatic: {
|
serveStatic: {
|
||||||
|
cacheControl: true,
|
||||||
|
dotfiles: 'allow',
|
||||||
maxAge: '365d',
|
maxAge: '365d',
|
||||||
etag: true,
|
etag: true,
|
||||||
lastModified: 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