feat: prepare CMS pages for deployment
This commit is contained in:
+34
-1
@@ -3,6 +3,8 @@ import createNextIntlPlugin from 'next-intl/plugin'
|
||||
|
||||
const withNextIntl = createNextIntlPlugin('./src/i18n/request.ts')
|
||||
|
||||
const PUBLIC_PAGE_CACHE_CONTROL = 'public, max-age=0, s-maxage=300, stale-while-revalidate=86400'
|
||||
|
||||
/** @type {import('next').NextConfig} */
|
||||
const nextConfig = {
|
||||
reactStrictMode: true,
|
||||
@@ -29,11 +31,42 @@ const nextConfig = {
|
||||
|
||||
// Footer / secondary
|
||||
{ source: '/Contact/afterservice.html', destination: '/en/support/warranty', permanent: true },
|
||||
{ source: '/Contact/distributor.html', destination: '/en/dealers', permanent: true },
|
||||
{ source: '/Contact/distributor.html', destination: '/en/where-to-buy', permanent: true },
|
||||
{ source: '/Contact/oem.html', destination: '/en/support/contact', permanent: true },
|
||||
|
||||
]
|
||||
},
|
||||
async headers() {
|
||||
return [
|
||||
{
|
||||
source: '/:locale(en|zh)',
|
||||
headers: [
|
||||
{
|
||||
key: 'Cache-Control',
|
||||
value: PUBLIC_PAGE_CACHE_CONTROL,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
source: '/:locale(en|zh)/:path*',
|
||||
headers: [
|
||||
{
|
||||
key: 'Cache-Control',
|
||||
value: PUBLIC_PAGE_CACHE_CONTROL,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
source: '/sitemap.xml',
|
||||
headers: [
|
||||
{
|
||||
key: 'Cache-Control',
|
||||
value: PUBLIC_PAGE_CACHE_CONTROL,
|
||||
},
|
||||
],
|
||||
},
|
||||
]
|
||||
},
|
||||
}
|
||||
|
||||
export default withNextIntl(withPayload(nextConfig))
|
||||
|
||||
Reference in New Issue
Block a user