Files
JJ KasperandGitHub a916dfc7d2 Add ability to customize Cache-Control (#69802)
This continues https://github.com/vercel/next.js/pull/39707 bringing the
changes up to date with canary and adds test cases to ensure it's
working as expected.

Closes: https://github.com/vercel/next.js/issues/22319
Closes: https://github.com/vercel/next.js/pull/39707
Closes: NDX-148
2024-09-09 12:58:07 -07:00

75 lines
1.3 KiB
JavaScript

/**
* @type {import('next').NextConfig}
*/
const nextConfig = {
headers() {
return [
{
source: '/app-ssg/first',
headers: [
{
key: 'Cache-Control',
value: 's-maxage=30',
},
],
},
{
source: '/app-ssg/lazy',
headers: [
{
key: 'Cache-Control',
value: 's-maxage=31',
},
],
},
{
source: '/app-ssr',
headers: [
{
key: 'Cache-Control',
value: 's-maxage=32',
},
],
},
{
source: '/pages-auto-static',
headers: [
{
key: 'Cache-Control',
value: 's-maxage=33',
},
],
},
{
source: '/pages-ssg/first',
headers: [
{
key: 'Cache-Control',
value: 's-maxage=34',
},
],
},
{
source: '/pages-ssg/lazy',
headers: [
{
key: 'Cache-Control',
value: 's-maxage=35',
},
],
},
{
source: '/pages-ssr',
headers: [
{
key: 'Cache-Control',
value: 's-maxage=36',
},
],
},
]
},
}
module.exports = nextConfig