From 55e8368dbc3e80979d34fe9d724f0a9c979833af Mon Sep 17 00:00:00 2001 From: metatroncubeswdev Date: Mon, 20 Apr 2026 00:13:40 -0400 Subject: [PATCH] improved the performance --- next.config.ts | 25 +- package-lock.json | 11 - public/Lighthouse-Optimization-Complete.md | 139 +++++++ public/assets/css/fontawesome-pro.css | 2 +- public/assets/css/main.css | 5 +- public/llms.txt | 118 +++--- public/robots.txt | 27 +- src/app/[slug]/BlogDetailsClient.tsx | 2 +- src/app/about/page.tsx | 2 +- .../page.tsx | 2 +- src/app/blog/page.tsx | 2 +- src/app/blog/results/page.tsx | 5 +- src/app/careers/page.tsx | 2 +- src/app/contact/page.tsx | 2 +- src/app/faq/page.tsx | 33 +- src/app/globals.css | 50 ++- src/app/layout.tsx | 246 ++++++++---- src/app/page.tsx | 2 +- src/app/portfolio/page.tsx | 2 +- src/app/privacy-policy/page.tsx | 2 +- src/app/service/[slug]/page.tsx | 16 +- src/app/services-digital-solutions/page.tsx | 2 +- src/components/about/Results.tsx | 8 +- src/components/about/WhyChooseUs.tsx | 6 +- src/components/blog/BlogDetails.tsx | 2 +- src/components/blog/BlogSidebar.tsx | 3 +- .../careers/CareersContactPopup.tsx | 1 + src/components/careers/CareersWorkProcess.tsx | 2 +- src/components/careers/ContactSection.tsx | 5 +- src/components/careers/FaqVideoSection.tsx | 1 + src/components/careers/ServiceSection.tsx | 2 +- src/components/careers/WorkProcessSection.tsx | 2 +- src/components/common/BackToTop.tsx | 8 +- .../common/ContactPopup/ContactPopup.tsx | 9 +- src/components/common/CookieConsent.tsx | 354 ++++++++++++++++++ src/components/common/Offcanvas.tsx | 20 +- src/components/common/SearchOverlay.tsx | 10 +- src/components/common/SectionTitle.tsx | 2 +- src/components/contact/ContactSection.tsx | 9 +- src/components/faq/FaqPageSection.tsx | 2 +- src/components/home/AboutThree.tsx | 2 +- src/components/home/AboutTwo.tsx | 2 +- src/components/home/CounsellingSolutions.tsx | 2 +- src/components/home/CounterAreaTwo.tsx | 11 +- src/components/home/FaqFour.tsx | 2 +- src/components/home/HistoryTwo.tsx | 2 +- src/components/home/HomeContactOne.tsx | 7 +- src/components/home/HomeServiceOne.tsx | 2 +- src/components/home/PortfolioSection.tsx | 14 +- src/components/home/ProjectsSection.tsx | 2 +- src/components/home/WhyChooseTwo.tsx | 2 +- src/components/home/home-1/AboutSection.tsx | 20 +- src/components/home/home-1/BannerSection.tsx | 28 +- src/components/home/home-1/BlogSection.tsx | 4 +- src/components/home/home-1/BrandSection.tsx | 3 + src/components/home/home-1/ChooseSection.tsx | 8 +- .../home/home-1/TestimonialsSection.tsx | 10 +- src/components/home/home-2/About2Section.tsx | 2 +- .../home/home-2/WorkProcessSection.tsx | 2 +- src/components/layout/Footer1.tsx | 23 +- src/components/layout/Header1.tsx | 18 +- .../support/cards/MemberCard.tsx | 12 +- .../common/ContactPopup/ContactPopup.tsx | 1 + .../support/layout/Footer/Footer.tsx | 22 +- .../support/layout/MainLayout.tsx | 2 +- .../AboutService.tsx | 8 +- .../ServiceDetails.tsx | 12 +- .../web-development-service/Hero.tsx | 3 +- .../support/layout/Footer/Footer.tsx | 22 +- .../support/layout/MainLayout.tsx | 2 +- 70 files changed, 1054 insertions(+), 339 deletions(-) create mode 100644 public/Lighthouse-Optimization-Complete.md create mode 100644 src/components/common/CookieConsent.tsx diff --git a/next.config.ts b/next.config.ts index c624be0..c38f42b 100644 --- a/next.config.ts +++ b/next.config.ts @@ -1,27 +1,18 @@ /** @type {import('next').NextConfig} */ const nextConfig = { - output: "export", - reactStrictMode: false, + output: "export", // Static HTML export — served via nginx/CDN + reactStrictMode: true, // Enables strict mode to catch bugs early trailingSlash: true, images: { - unoptimized: true, // ⬅ required for static export to work with next/image - domains: ['your-cdn.com', 'images.unsplash.com'], // allow external domains + unoptimized: true, // Required for static export (no Next.js image server) }, - async headers() { - return [ - { - source: '/(.*)', - headers: [ - { - key: 'Cache-Control', - value: 'no-store, no-cache, must-revalidate, proxy-revalidate', - }, - ], - }, - ]; - }, + // NOTE: async headers() is NOT supported with output:"export" + // Cache-Control headers must be set at the web server level (nginx/Apache/CDN). + // Recommended nginx config for production: + // location ~* \.(html)$ { add_header Cache-Control "public, max-age=0, must-revalidate"; } + // location ~* \.(js|css|woff2|webp|png|jpg|svg)$ { add_header Cache-Control "public, max-age=31536000, immutable"; } }; module.exports = nextConfig; diff --git a/package-lock.json b/package-lock.json index 970c2b6..286465c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1163,7 +1163,6 @@ "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz", "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==", "license": "MIT", - "peer": true, "funding": { "type": "opencollective", "url": "https://opencollective.com/popperjs" @@ -1261,7 +1260,6 @@ "resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.14.tgz", "integrity": "sha512-ilcTH/UniCkMdtexkoCN0bI7pMcJDvmQFPvuPvmEaYA/NSfFTAgdUSLAoVjaRJm7+6PvcM+q1zYOwS4wTYMF9w==", "license": "MIT", - "peer": true, "dependencies": { "csstype": "^3.2.2" } @@ -1349,7 +1347,6 @@ "integrity": "sha512-IgSWvLobTDOjnaxAfDTIHaECbkNlAlKv2j5SjpB2v7QHKv1FIfjwMy8FsDbVfDX/KjmCmYICcw7uGaXLhtsLNg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@typescript-eslint/scope-manager": "8.56.0", "@typescript-eslint/types": "8.56.0", @@ -1875,7 +1872,6 @@ "integrity": "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==", "dev": true, "license": "MIT", - "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -2850,7 +2846,6 @@ "integrity": "sha512-VmQ+sifHUbI/IcSopBCF/HO3YiHQx/AVd3UVyYL6weuwW+HvON9VYn5l6Zl1WZzPWXPNZrSQpxwkkZ/VuvJZzg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.8.0", "@eslint-community/regexpp": "^4.12.1", @@ -3024,7 +3019,6 @@ "integrity": "sha512-whOE1HFo/qJDyX4SnXzP4N6zOWn79WhnCUY/iDR0mPfQZO8wcYE4JClzI2oZrhBnnMUCBCHZhO6VQyoBU95mZA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@rtsao/scc": "^1.1.0", "array-includes": "^3.1.9", @@ -5044,7 +5038,6 @@ "resolved": "https://registry.npmjs.org/react/-/react-19.2.3.tgz", "integrity": "sha512-Ku/hhYbVjOQnXDZFv2+RibmLFGwFdeeKHFcOTlrt7xplBnya5OGn/hIRDsqDiSUcfORsDC7MPxwork8jBwsIWA==", "license": "MIT", - "peer": true, "engines": { "node": ">=0.10.0" } @@ -5079,7 +5072,6 @@ "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.3.tgz", "integrity": "sha512-yELu4WmLPw5Mr/lmeEpox5rw3RETacE++JgHqQzd2dg+YbJuat3jH4ingc+WPZhxaoFzdv9y33G+F7Nl5O0GBg==", "license": "MIT", - "peer": true, "dependencies": { "scheduler": "^0.27.0" }, @@ -5348,7 +5340,6 @@ "resolved": "https://registry.npmjs.org/sass/-/sass-1.97.3.tgz", "integrity": "sha512-fDz1zJpd5GycprAbu4Q2PV/RprsRtKC/0z82z0JLgdytmcq0+ujJbJ/09bPGDxCLkKY3Np5cRAOcWiVkLXJURg==", "license": "MIT", - "peer": true, "dependencies": { "chokidar": "^4.0.0", "immutable": "^5.0.2", @@ -5953,7 +5944,6 @@ "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=12" }, @@ -6125,7 +6115,6 @@ "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "dev": true, "license": "Apache-2.0", - "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" diff --git a/public/Lighthouse-Optimization-Complete.md b/public/Lighthouse-Optimization-Complete.md new file mode 100644 index 0000000..8f3397a --- /dev/null +++ b/public/Lighthouse-Optimization-Complete.md @@ -0,0 +1,139 @@ +# Metatroncube Lighthouse & SEO Optimization — Full Change Log + +**Completed:** April 2026 +**Target:** 100/100 on all Lighthouse categories (Performance, Accessibility, Best Practices, SEO) +**Starting scores:** Performance 75 | Accessibility 88 | Best Practices 77 | SEO 100 + +--- + +## ✅ Performance Fixes + +### CSS Render-Blocking Eliminated +- **bootstrap.min.css, main.css, spacing.css** → kept as critical (required for initial paint) +- **fontawesome-pro.css, animate.css, swiper.min.css, slick.css, magnific-popup.css, meanmenu.min.css** → deferred using `media="print" onLoad="this.media='all'"` pattern (~820ms savings) +- **Google Fonts (Inter)** → moved from `@import` in `main.css` to async `` in layout.tsx with preconnect hints +- Added `