From 7caf02fb365e16c2067b5cecbc6ff7ee472f0ed5 Mon Sep 17 00:00:00 2001 From: Lorenzo Iovino Date: Thu, 8 Jan 2026 18:18:28 +0100 Subject: [PATCH] perf: improve Lighthouse performance score Fix render blocking and layout shift issues: - Make Google Fonts non-blocking with font-display: swap - Inline critical font-face declaration to prevent FOIT - Add fetchpriority='high' and loading='eager' to hero LCP image - Remove lazy loading from above-the-fold content Expected improvements: - CLS: reduced layout shift from web font loading - FCP/LCP: faster by removing render-blocking fonts (saves ~840ms) - Performance score: should improve from 81 to 90+ Remaining optimizations can be done later: - Minify JavaScript (173 KB) - Reduce unused JavaScript (295 KB) - These require more complex bundling optimizations --- src/components/Footer.astro | 36 +++++++++++++++++----------------- src/components/Hero.astro | 6 ++++-- src/components/Navbar.astro | 22 ++++++++++----------- src/components/Section.astro | 2 +- src/layouts/BaseLayout.astro | 15 ++++++++++---- src/pages/bio.astro | 10 +++++----- src/pages/blog.astro | 18 ++++++++--------- src/pages/blog/[slug].astro | 2 ++ src/pages/blog/tag/[tag].astro | 6 +++--- 9 files changed, 64 insertions(+), 53 deletions(-) diff --git a/src/components/Footer.astro b/src/components/Footer.astro index 5ead5ee..2e49a99 100644 --- a/src/components/Footer.astro +++ b/src/components/Footer.astro @@ -7,27 +7,27 @@ import githubIcon from "../assets/github.svg";
-
+
Lorenzo Iovino - + RSS - + Sitemap - + Privacy Policy - + Cookie Policy
-
+
diff --git a/src/components/Hero.astro b/src/components/Hero.astro index 595b340..76cada3 100644 --- a/src/components/Hero.astro +++ b/src/components/Hero.astro @@ -23,6 +23,8 @@ import githubIcon from "../assets/github.svg"; height={300} quality={90} format="webp" + loading="eager" + fetchpriority="high" />
@@ -64,7 +66,7 @@ import githubIcon from "../assets/github.svg"; > LinkedIn GitHub Lorenzo Iovino @@ -18,7 +18,7 @@ const currentPath = Astro.url.pathname; Home @@ -26,7 +26,7 @@ const currentPath = Astro.url.pathname; Bio @@ -34,7 +34,7 @@ const currentPath = Astro.url.pathname; Blog @@ -44,7 +44,7 @@ const currentPath = Astro.url.pathname;