From ea21d173b2018fe2c8342cb57d4b3bdfbfb7183b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yusuf=20=C4=B0pek?= Date: Sat, 14 Feb 2026 17:15:35 +0300 Subject: [PATCH] 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 --- next.config.ts | 47 +++++++++++++++++++++++++++++++++++++++++++++++ package.json | 1 - 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/next.config.ts b/next.config.ts index 9aa07dd..a49252d 100644 --- a/next.config.ts +++ b/next.config.ts @@ -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', + }, + ], + }, + ]; }, }; diff --git a/package.json b/package.json index 4ad52a5..c9b91a4 100644 --- a/package.json +++ b/package.json @@ -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",