fix(cache): add aggressive no-store middleware, CSP updates, and client-side service worker & cache purge
This commit is contained in:
+10
-5
@@ -62,18 +62,23 @@ const nextConfig = {
|
||||
key: 'Content-Security-Policy',
|
||||
value: [
|
||||
"default-src 'self'",
|
||||
"script-src 'self' 'unsafe-inline' 'unsafe-eval' https://apis.google.com",
|
||||
"style-src 'self' 'unsafe-inline' https://fonts.googleapis.com",
|
||||
"font-src 'self' https://fonts.gstatic.com",
|
||||
"script-src 'self' 'unsafe-inline' 'unsafe-eval' https://apis.google.com https://challenges.cloudflare.com",
|
||||
"style-src 'self' 'unsafe-inline' https://fonts.googleapis.com https://fonts.cdnfonts.com",
|
||||
"font-src 'self' https://fonts.gstatic.com https://fonts.cdnfonts.com data:",
|
||||
"img-src 'self' data: blob: https:",
|
||||
"connect-src 'self' https://*.firebaseapp.com https://*.googleapis.com https://identitytoolkit.googleapis.com https://securetoken.googleapis.com",
|
||||
"frame-src 'self' https://accounts.google.com",
|
||||
"connect-src 'self' https://*.firebaseapp.com https://*.googleapis.com https://identitytoolkit.googleapis.com https://securetoken.googleapis.com https://challenges.cloudflare.com",
|
||||
"frame-src 'self' https://accounts.google.com https://challenges.cloudflare.com",
|
||||
"object-src 'none'",
|
||||
"base-uri 'self'",
|
||||
"form-action 'self'",
|
||||
...(isProd ? ["upgrade-insecure-requests"] : []),
|
||||
].join('; '),
|
||||
},
|
||||
// Strict Cache-Control to prevent browsers & CDNs from serving stale HTML
|
||||
{ key: 'Cache-Control', value: 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0, s-maxage=0' },
|
||||
{ key: 'Pragma', value: 'no-cache' },
|
||||
{ key: 'Expires', value: '0' },
|
||||
{ key: 'Surrogate-Control', value: 'no-store' },
|
||||
// Block clickjacking
|
||||
{ key: 'X-Frame-Options', value: 'SAMEORIGIN' },
|
||||
// Prevent MIME sniffing
|
||||
|
||||
Reference in New Issue
Block a user