mirror of
https://github.com/yusufipk/OpenFrame.git
synced 2026-09-11 17:46:06 +00:00
perf(config): improve performance with image optimization, caching headers, and build optimizations
- Add AVIF and WebP image formats for optimized delivery - Configure cache headers for static assets (images, icons, SVGs) - Enable server minification and optimize package imports - Disable poweredByHeader and enable compression - Remove unused radix-ui dependency
This commit is contained in:
@@ -9,6 +9,53 @@ const nextConfig: NextConfig = {
|
||||
{ protocol: 'https', hostname: 'vumbnail.com' },
|
||||
{ protocol: 'https', hostname: 'images.unsplash.com' },
|
||||
],
|
||||
formats: ['image/avif', 'image/webp'],
|
||||
},
|
||||
experimental: {
|
||||
optimizePackageImports: ['lucide-react', 'radix-ui'],
|
||||
serverMinification: true,
|
||||
},
|
||||
poweredByHeader: false,
|
||||
compress: true,
|
||||
async headers() {
|
||||
return [
|
||||
{
|
||||
source: '/_next/static/:path*',
|
||||
headers: [
|
||||
{
|
||||
key: 'Cache-Control',
|
||||
value: 'public, max-age=31536000, immutable',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
source: '/images/:path*',
|
||||
headers: [
|
||||
{
|
||||
key: 'Cache-Control',
|
||||
value: 'public, max-age=2592000',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
source: '/:path*.ico',
|
||||
headers: [
|
||||
{
|
||||
key: 'Cache-Control',
|
||||
value: 'public, max-age=604800',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
source: '/:path*.svg',
|
||||
headers: [
|
||||
{
|
||||
key: 'Cache-Control',
|
||||
value: 'public, max-age=2592000',
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -36,7 +36,6 @@
|
||||
"nodemailer": "^8.0.1",
|
||||
"pg": "^8.18.0",
|
||||
"prisma": "^7.3.0",
|
||||
"radix-ui": "^1.4.3",
|
||||
"react": "19.2.3",
|
||||
"react-dom": "19.2.3",
|
||||
"react-window": "^2.2.7",
|
||||
|
||||
Reference in New Issue
Block a user