Skip to content

Commit

Permalink
Merge pull request #519 from ertush/hotfix
Browse files Browse the repository at this point in the history
Modified next.config.js to add Cache-Control headers for all pages
  • Loading branch information
ertush authored Oct 24, 2024
2 parents 228fd26 + 4da9d13 commit 8c4949c
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
})

const cspHeader = `
default-src 'self';
script-src 'self' 'unsafe-eval' 'unsafe-inline';
style-src 'self' 'unsafe-inline';
img-src 'self' blob: data:;
font-src 'self';
object-src 'none';
base-uri 'self';
form-action 'self';
frame-ancestors 'none';
upgrade-insecure-requests;
`
// const cspHeader = `
// default-src 'self';
// script-src 'self' 'unsafe-eval' 'unsafe-inline';
// style-src 'self' 'unsafe-inline';
// img-src 'self' blob: data:;
// font-src 'self';
// object-src 'none';
// base-uri 'self';
// form-action 'self';
// frame-ancestors 'none';
// upgrade-insecure-requests;
// `

/** @type {import('next').NextConfig} */

Expand All @@ -23,19 +23,19 @@ const nextConfig = {
// largePageDataBytes: 168960 // 165kB; Default is 128kB
// }

// async headers() {
// return [
// {
// source: '/(.*)',
// headers: [
// {
// key: 'Content-Security-Policy',
// value: cspHeader.replace(/\n/g, ''),
// },
// ],
// },
// ]
// }
async headers() {
return [
{
source: '/(.*)',
headers: [
{
key: 'Cache-Control',
value: 'no-cache, no-store, max-age=0'
},
],
},
]
}


}
Expand Down

0 comments on commit 8c4949c

Please sign in to comment.