Back to Blog
AstroPerformanceSSGCore-Web-VitalsCloudflare

Why We Moved to Astro: Core Web Vitals Retrospective

A senior engineering retrospective on moving from heavy client-side SPAs to Astro: 0KB JS baseline, sub-200ms mobile INP, and Cloudflare Pages workerd delivery.

·4 min read·Fonda Digital Engineering

As an engineering agency specializing in high-performance web development, white-label delivery, and workflow automation, our digital presence is our primary technical portfolio. For years, our corporate website ran on a conventional single-page application (SPA) framework—a setup common across the digital agency sector.

Yet, despite rigorous code-splitting, tree-shaking, and asset optimization, our production telemetry revealed an embarrassing contradiction: visitors on mobile connections were downloading hundreds of kilobytes of JavaScript runtime just to read plain text, case studies, and service overviews.

In late 2025, we committed to eating our own dog food and executed a comprehensive rebuild on Astro 7 with Tailwind CSS v4 and Cloudflare Pages.

Here is the transparent engineering retrospective of that migration: why we abandoned monolithic SPA runtimes, how our Core Web Vitals transformed overnight, and what technical trade-offs you must consider before adopting Astro in production.


1. The SPA Hangover: Why Client Runtimes Break Editorial Performance

Modern JavaScript frameworks like Next.js, Remix, and Nuxt are formidable tools for building complex, authenticated software dashboards and state-heavy SaaS applications. However, deploying them for marketing sites, documentation hubs, and agency portals introduces structural architectural debt:

  1. Hydration Tax: Even when a page displays purely static copy, the browser must parse, compile, and execute the entire framework runtime to reconstruct the Virtual DOM in memory before the page becomes truly interactive.
  2. Main Thread Contention: On mid-range Android devices, executing 150KB–250KB of framework JavaScript blocks the main thread during initial page load, driving Interaction to Next Paint (INP) and Total Blocking Time (TBT) into Google Search Console’s “Needs Improvement” or “Poor” zones.
  3. Deployment Fragility: Server-rendered SPA frameworks demand dedicated Node.js servers or complex edge containers, increasing DevOps overhead and cold-start latency.

Marketing websites do not require client-side routing runtimes; they require pristine, semantic HTML delivered instantly over an edge CDN.

Traditional SPA Architecture:
[Request] ──▶ [Download 200KB JS Runtime] ──▶ [Parse & Compile] ──▶ [Hydrate DOM] ──▶ [Interactive]
                                                                                            ▲
Astro Static-First Architecture:                                                            │
[Request] ──▶ [Instant Static HTML & CSS] ──────────────────────────────────────────────────┴─ (0ms Delay)

2. Real Production Telemetry: Core Web Vitals Before & After

To validate the migration, we tracked 90 days of Chrome User Experience Report (CrUX) field data and simulated mobile network lab audits before and after deploying the Astro rebuild on Cloudflare Pages.

Telemetry Metric Previous Next.js SPA Astro 7 Static Rebuild Delta / Production Impact
First Contentful Paint (FCP) 1.82s 0.42s -76.9% reduction
Largest Contentful Paint (LCP) 2.64s 0.68s -74.2% reduction (Good zone)
Interaction to Next Paint (INP) 340ms (Needs Improvement) 38ms (Good) -88.8% latency reduction
Cumulative Layout Shift (CLS) 0.042 0.000 Zero visual shift
Total Blocking Time (TBT) 480ms 0ms 100% elimination
Initial JS Transfer (Home) 185 KB gzipped 0 KB 100% elimination of JS runtime
Lighthouse Mobile Score 68 / 100 100 / 100 Perfect mobile performance

The elimination of the client-side JavaScript baseline produced an immediate, permanent boost across our mobile Core Web Vitals. Because Astro renders components to pure HTML at build time, the browser paints typography and structure on the very first network tick.

Senior Engineering Advisory

Need senior engineering firepower on your next release?

Direct access to senior engineers specializing in ultra-fast Astro, Next.js, and high-converting architectures. No account managers, 4-hour SLA.

3. The Islands Architecture in Practice

Adopting a zero-JavaScript baseline does not mean surrendering interactive functionality. Astro’s Islands Architecture (astro:components) allows developers to embed isolated interactive widgets into static HTML pages using explicit hydration directives:

  • <TcoCalculator client:idle /> — Loads and hydrates our operational ROI calculator only after the main thread finishes initial page layout.
  • <MobileNav client:media="(max-width: 768px)" /> — Executes mobile navigation JavaScript only when the browser viewport matches mobile dimensions.
  • <LeadMagnet client:visible /> — Hydrates interactive form components only when the visitor scrolls them into the active viewport.

This granular control ensures that interactive components never penalize visitors who are simply scanning top-of-funnel technical guides or case studies.


4. Edge Infrastructure: Cloudflare Pages & workerd

Our Astro build compiles down to static HTML, CSS, and optimized SVG assets, which are deployed globally via GitHub Actions to Cloudflare Pages.

By leveraging Cloudflare’s edge network, static requests are terminated at the nearest Point of Presence (PoP) across 330+ cities worldwide, achieving a Time to First Byte (TTFB) below 40ms throughout Europe and North America.

For dynamic functionalities—such as our localized API contact endpoints (/functions/api/contact.js)—Cloudflare’s native workerd V8 isolate runtime handles form validation, honeypot spam filtering, and webhook dispatch with zero cold starts and zero server provisioning overhead.


5. Architectural Verdict & Recommendations

Moving our agency site to Astro was not an aesthetic choice; it was an engineering decision with quantifiable commercial returns. Organic search impressions improved as Core Web Vitals transitioned to 100% “Good” across all mobile URLs, while editorial updates became simple Markdown commits reviewed through GitHub Actions PR previews.

If your agency or enterprise manages content-rich web properties currently burdened by SPA framework overhead, migrating to Astro represents the highest-leverage technical upgrade available in 2026.

To continue evaluating modern headless web architectures and performance engineering, explore our technical guides:

Interested in auditing your current web stack or executing a high-performance migration? Contact our engineering team to schedule a technical architecture review.

Frequently Asked Questions

Why is Astro superior to Next.js or Nuxt for marketing and content websites?→
Astro defaults to zero client-side JavaScript. While Next.js and Nuxt hydrate the entire page into a single-page application (SPA) runtime by default, Astro compiles pages into flat, static HTML and CSS. JavaScript is only downloaded and executed for specific interactive components designated with client:* directives.
What Core Web Vitals improvements did Fonda Digital achieve after moving to Astro?→
Our production metrics saw Largest Contentful Paint (LCP) drop from 2.6 seconds to 0.68 seconds, Interaction to Next Paint (INP) drop from 340ms to 38ms on mobile devices, and the initial JavaScript payload reduced from 185KB gzipped to exactly 0KB on standard editorial routes.
How does Astro integrate with Cloudflare Pages workerd edge delivery?→
Astro static builds compile down to optimized static assets delivered via Cloudflare global edge caches. When server rendering or dynamic API endpoints are needed, the official @astrojs/cloudflare adapter compiles routes directly into native Cloudflare Workers running on the lightweight workerd runtime.
START AN ENGINEERING ENGAGEMENT

Let's build.

Send over your technical brief or project scope. You'll receive an assessment directly from a senior technical lead within 4 business hours.

Fonda Digital

Senior full-stack engineering boutique based in Ljubljana and Izola, Slovenia. Direct access to the engineer writing your code, with zero junior hand-offs.

BASE:Ljubljana / Izola, Slovenia
RESPONSE WINDOW:Within 4 Business Hours (CET)
DIRECT CHANNEL:[email protected]
CURRENT TIME: LJUBLJANA--:--:-- CET
Estimated Budget

Automated spam protection.