From b3b27f5bd1062483b471d6d67983c4a18a122ea2 Mon Sep 17 00:00:00 2001 From: punjitha <132387971+algotyrnt@users.noreply.github.com> Date: Sun, 17 May 2026 22:35:34 +0530 Subject: [PATCH 1/4] Implement performance optimizations including asset prefetching, security headers, lazy loading, and streamlined theme initialization --- next.config.ts | 20 ++++++++++++++++++++ src/app/globals.css | 3 +++ src/app/layout.tsx | 12 ++++++++++++ src/components/layout/footer.tsx | 13 +++++++++++-- src/components/sections/privacy.tsx | 2 ++ src/components/theme/registry.tsx | 19 +++---------------- src/components/theme/theme.ts | 5 ++++- src/components/ui/use-in-view.ts | 7 +------ 8 files changed, 56 insertions(+), 25 deletions(-) diff --git a/next.config.ts b/next.config.ts index b899aa4..03e116d 100644 --- a/next.config.ts +++ b/next.config.ts @@ -3,7 +3,27 @@ import type { NextConfig } from 'next' const nextConfig: NextConfig = { experimental: { optimizePackageImports: ['@mui/material', '@mui/icons-material'], + cssChunking: 'strict', }, + headers: async () => [ + { + source: '/(.*)', + headers: [ + { key: 'X-Content-Type-Options', value: 'nosniff' }, + { key: 'X-Frame-Options', value: 'DENY' }, + { key: 'Referrer-Policy', value: 'strict-origin-when-cross-origin' }, + ], + }, + { + source: '/_next/static/(.*)', + headers: [ + { + key: 'Cache-Control', + value: 'public, max-age=31536000, immutable', + }, + ], + }, + ], } export default nextConfig diff --git a/src/app/globals.css b/src/app/globals.css index b2555e1..d2f800c 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -109,6 +109,7 @@ body { .fade-in { opacity: 0; + will-change: transform, opacity; } .fade-in--visible { @@ -119,6 +120,7 @@ body { /* Stagger children – replaces framer-motion StaggerWrapper/StaggerItem */ .stagger-item { opacity: 0; + will-change: transform, opacity; } .stagger-item--visible { @@ -140,6 +142,7 @@ body { .header-fade--delayed { animation: none; opacity: 1; + will-change: auto; } } diff --git a/src/app/layout.tsx b/src/app/layout.tsx index e8ad87d..45834a4 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -107,6 +107,18 @@ export default function RootLayout({ return ( + + + +