mirror of
https://github.com/BobbyWibowo/lolisafe.git
synced 2025-01-31 07:11:33 +00:00
fix: no-cache cache-control for static assets
when cacheControl is disabled in config this behavior makes more sense, and will then properly rely on our internal conditinal GETs handlers and whatnot
This commit is contained in:
parent
b1566c5abf
commit
bea63b07d8
@ -128,8 +128,10 @@ safe.use(nunjucksRendererInstance.middleware)
|
||||
// and additionally call Cloudflare API to have their CDN caches purged when lolisafe starts
|
||||
const cdnRoutes = [...config.pages]
|
||||
|
||||
// Defaults to no-op
|
||||
let setHeadersForStaticAssets = () => {}
|
||||
// Defaults to validating cache's validity before using them (soft cache)
|
||||
let setHeadersForStaticAssets = (req, res) => {
|
||||
res.header('Cache-Control', 'no-cache')
|
||||
}
|
||||
|
||||
// Cache control
|
||||
if (config.cacheControl) {
|
||||
|
Loading…
Reference in New Issue
Block a user