Files
bootnode/web/next.config.ts
T
zeekay 7f1ba0733f fix: add CDN cache headers to prevent stale content
- Add CDN-Cache-Control header (60s) for HTML pages
- Keep long cache (1 year) for immutable static assets
- Prevents Cloudflare from serving stale branded content
2026-02-04 11:48:10 -08:00

81 lines
1.6 KiB
TypeScript

import type { NextConfig } from "next"
const nextConfig: NextConfig = {
// Modern React & Next.js features
reactStrictMode: true,
// Production-ready output
output: "standalone",
devIndicators: false,
// Turbopack configuration (required for Next.js 16)
turbopack: {},
// Security and cache headers
async headers() {
return [
{
source: '/(.*)',
headers: [
{
key: 'X-Frame-Options',
value: 'DENY'
},
{
key: 'X-Content-Type-Options',
value: 'nosniff'
},
{
key: 'Referrer-Policy',
value: 'strict-origin-when-cross-origin'
},
{
// Prevent aggressive edge caching for HTML pages
key: 'CDN-Cache-Control',
value: 'max-age=60'
}
]
},
{
// Static assets can be cached longer
source: '/_next/static/(.*)',
headers: [
{
key: 'Cache-Control',
value: 'public, max-age=31536000, immutable'
}
]
}
]
},
// Environment variables
env: {
CUSTOM_PORT: '3001'
},
// Image optimization for modern formats
images: {
remotePatterns: [
{
protocol: "https",
hostname: "**",
},
],
formats: ['image/avif', 'image/webp']
},
// Redirects from legacy admin paths
async redirects() {
return [
{
source: '/admin/:path*',
destination: '/dashboard/:path*',
permanent: true,
},
]
}
}
export default nextConfig