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:
Bobby Wibowo 2022-07-31 14:10:44 +07:00
parent b1566c5abf
commit bea63b07d8
No known key found for this signature in database
GPG Key ID: 51C3A1E1E22D26CF

View File

@ -128,8 +128,10 @@ safe.use(nunjucksRendererInstance.middleware)
// and additionally call Cloudflare API to have their CDN caches purged when lolisafe starts // and additionally call Cloudflare API to have their CDN caches purged when lolisafe starts
const cdnRoutes = [...config.pages] const cdnRoutes = [...config.pages]
// Defaults to no-op // Defaults to validating cache's validity before using them (soft cache)
let setHeadersForStaticAssets = () => {} let setHeadersForStaticAssets = (req, res) => {
res.header('Cache-Control', 'no-cache')
}
// Cache control // Cache control
if (config.cacheControl) { if (config.cacheControl) {