From e0d6ea0d6ce7c4b52c268d9d549e87353b05fe4a Mon Sep 17 00:00:00 2001 From: Marc Mintel Date: Sat, 20 Jun 2026 20:32:08 +0200 Subject: [PATCH] perf: implement KLZ blueprint optimizations (LCP, Payload, Caching) --- app/[locale]/layout.tsx | 2 -- app/[locale]/page.tsx | 23 ++++++++++++----------- components/blocks/HeroVideo.tsx | 9 +++------ next.config.mjs | 4 ++++ 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/app/[locale]/layout.tsx b/app/[locale]/layout.tsx index a23f0eec5..d0b8b3f85 100644 --- a/app/[locale]/layout.tsx +++ b/app/[locale]/layout.tsx @@ -186,8 +186,6 @@ export default async function Layout(props: { data-scroll-behavior="smooth" > - - diff --git a/app/[locale]/page.tsx b/app/[locale]/page.tsx index 271b43010..0c6dd9826 100644 --- a/app/[locale]/page.tsx +++ b/app/[locale]/page.tsx @@ -6,21 +6,22 @@ import { MDXRemote } from 'next-mdx-remote/rsc'; export const dynamic = 'force-dynamic'; -// Import components used in MDX -import { HeroVideo as HomeHero } from '@/components/blocks/HeroVideo'; -import { SubCompanyTiles as HomeSubCompanyTiles } from '@/components/blocks/SubCompanyTiles'; -import { CompetenceBentoGrid as HomeCompetenceBentoGrid } from '@/components/blocks/CompetenceBentoGrid'; -import { ReferencesSlider as HomeReferencesSlider } from '@/components/blocks/ReferencesSlider'; -import { FaqBlock } from '@/components/blocks/FaqBlock'; -import { CertificatesBlock } from '@/components/blocks/CertificatesBlock'; -import { HeroSection } from '@/components/blocks/HeroSection'; +import dynamic from 'next/dynamic'; + +const HomeHero = dynamic(() => import('@/components/blocks/HeroVideo').then(mod => mod.HeroVideo), { ssr: true }); +const HomeSubCompanyTiles = dynamic(() => import('@/components/blocks/SubCompanyTiles').then(mod => mod.SubCompanyTiles)); +const HomeCompetenceBentoGrid = dynamic(() => import('@/components/blocks/CompetenceBentoGrid').then(mod => mod.CompetenceBentoGrid)); +const HomeReferencesSlider = dynamic(() => import('@/components/blocks/ReferencesSlider').then(mod => mod.ReferencesSlider)); +const FaqBlock = dynamic(() => import('@/components/blocks/FaqBlock').then(mod => mod.FaqBlock)); +const CertificatesBlock = dynamic(() => import('@/components/blocks/CertificatesBlock').then(mod => mod.CertificatesBlock)); +const HeroSection = dynamic(() => import('@/components/blocks/HeroSection').then(mod => mod.HeroSection), { ssr: true }); import JsonLd from '@/components/JsonLd'; import { Button } from '@/components/ui/Button'; import { Heading } from '@/components/ui/Heading'; -import { AnimatedCounter } from '@/components/ui'; -import { InteractiveGermanyMap } from '@/components/blocks/InteractiveGermanyMap'; -import { ScaleOfImpact } from '@/components/blocks/ScaleOfImpact'; +const AnimatedCounter = dynamic(() => import('@/components/ui').then(mod => mod.AnimatedCounter)); +const InteractiveGermanyMap = dynamic(() => import('@/components/blocks/InteractiveGermanyMap').then(mod => mod.InteractiveGermanyMap)); +const ScaleOfImpact = dynamic(() => import('@/components/blocks/ScaleOfImpact').then(mod => mod.ScaleOfImpact)); import { getAllReferences } from '@/lib/references'; const mdxComponents = (references: any[]) => ({ diff --git a/components/blocks/HeroVideo.tsx b/components/blocks/HeroVideo.tsx index 23649cf85..291ef366d 100644 --- a/components/blocks/HeroVideo.tsx +++ b/components/blocks/HeroVideo.tsx @@ -2,7 +2,6 @@ import { Button } from '@/components/ui/Button'; import Image from 'next/image'; -import { motion, AnimatePresence } from 'framer-motion'; import { useState, useEffect } from 'react'; import { usePathname } from 'next/navigation'; @@ -81,11 +80,9 @@ export function HeroVideo(props: HeroVideoProps) {
-

- +
); diff --git a/next.config.mjs b/next.config.mjs index ace207bcb..f79a25db5 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -15,6 +15,10 @@ const nextConfig = { pagesBufferLength: 2, }, experimental: { + staleTimes: { + dynamic: 0, + static: 30, + }, optimizePackageImports: [ 'lucide-react', 'framer-motion',