How to Achieve 100/100 on PageSpeed Insights

Back to Blog

Why write about PageSpeed optimization in 2025?

PageSpeed optimization isn't new. Google released Lighthouse in 2016, and performance best practices have been documented for years. You might expect that by 2025, most professional websites would score well.

The opposite is true.

Modern websites are often slower than sites built five years ago. Despite faster networks and more powerful devices, the average website in 2025 is heavier, more complex, and performs worse than its predecessors. Why?

The complexity creep:

  • Modern frameworks ship more JavaScript by default
  • Analytics, marketing pixels, and chat widgets accumulate over time
  • High-resolution images and videos are now standard
  • Third-party integrations (payment processors, CRMs, booking systems) each add overhead
  • "It works on my machine" testing misses real-world mobile performance

I regularly encounter professionally built websites from 2024-2025 scoring 40-70/100. These aren't old legacy sites—they're new builds using modern tools, costing thousands of dollars, from established agencies.

Why does achieving 100/100 matter?

You might ask: "Isn't 85/100 good enough? Does the last 15 points really matter?"

The answer depends on what you're optimizing for.

The business case:

Google's research shows that 53% of mobile users abandon sites taking longer than 3 seconds to load. Each additional second of load time correlates with approximately 7% reduction in conversions. These aren't small numbers—they directly affect revenue.

For a business with 10,000 monthly visitors and a 3% conversion rate:

  • A fast site (2 seconds, 100/100 score): 300 conversions/month
  • A slow site (8 seconds, 60/100 score): Approximately 210 conversions/month

That's 90 lost conversions monthly. At $100 average transaction value, that's $108,000/year in lost revenue.

The SEO case:

Core Web Vitals became Google ranking factors in 2021. Two identical sites with identical content will rank differently based on performance. The faster site gets more organic traffic. More traffic means more conversions. The performance advantage compounds over time.

The user experience case:

Beyond metrics, there's a qualitative difference between a site that scores 85/100 and one that scores 100/100. The 100/100 site feels instant. Content appears immediately. Nothing jumps around. Users trust it more, engage more, and return more often.

The competitive advantage:

If your competitors score 60-70/100 and you score 100/100, you've created a measurable advantage in user experience, search rankings, and conversion rates. In competitive markets, these margins matter.

So yes, the last 15 points matter—not for the score itself, but for the business outcomes those points represent.


What does a perfect PageSpeed score require?

Most developers know the basics—optimize images, minify CSS, reduce JavaScript. But knowing the basics and achieving 100/100 are different things. The gap between 85/100 and 100/100 isn't about doing more of the same. It requires understanding which techniques have the most impact and implementing them correctly.

I've built multiple sites scoring 100/100/100/100 across all four metrics (Performance, Accessibility, Best Practices, SEO). In this guide, I'll explain the specific techniques that matter most, why they work, and what to watch out for.

100
Performance
100
Accessibility
100
Best Practices
100
SEO

You'll learn:

  • How critical CSS inlining affects render times
  • Why image format choice matters more than compression level
  • How to eliminate render-blocking resources
  • What causes layout shift and how to prevent it
  • How to test performance under real-world conditions

Before we start, a reality check: getting to 100/100 takes time the first time through—typically 4-6 hours for a complete site. Once you understand the patterns, subsequent optimizations go faster. But there's no shortcut around learning what works.


Why does critical CSS inlining improve scores?

The problem: When browsers load a page, external CSS files block rendering. The browser downloads your HTML, encounters <link rel="stylesheet">, pauses rendering, downloads the CSS, parses it, then finally renders the page. This delay affects your Largest Contentful Paint (LCP) score significantly.

The solution: Inline your critical CSS directly in the <head> tag. The browser can render immediately without waiting for external files.

A real example: A professional services site I optimized scored 94/100 before CSS inlining. After moving critical styles inline, it scored 100/100. The only change was moving approximately 3KB of above-the-fold CSS into the HTML head.

Here's what that structure looks like:

<head>
  <style>
    /* Critical CSS - inline everything needed for initial render */
    body { margin: 0; font-family: system-ui, sans-serif; }
    header { background: #1a1a1a; color: white; padding: 1rem; }
    .hero { min-height: 400px; background: linear-gradient(...); }
  </style>

  <!-- Load non-critical CSS asynchronously -->
  <link rel="stylesheet" href="/full-styles.css"
        media="print" onload="this.media='all'">
</head>

What to watch for: Keep inline CSS under 8KB. Beyond this size, you're delaying HTML download time, which can actually hurt your First Contentful Paint score instead of helping it. Extract only the styles needed for above-the-fold content.

Framework considerations: If you're using Nuxt, Next.js, or similar frameworks, look for build-time CSS extraction features. Nuxt's experimental.inlineSSRStyles handles this automatically during static generation.


How do modern image formats reduce file size?

The problem: Images typically account for 60-80% of page weight. Unoptimized images directly affect load times, especially on mobile networks.

The solution: Use AVIF format where supported, with WebP fallback, and serve appropriately sized images for different viewports.

A real example: I built a restaurant website (craivings.codecrank.ai) with 117 pages and over 300 AI-generated images. Initial image exports totaled approximately 3.1MB per page. After optimization:

  • Format conversion: Changed from PNG/JPG to AVIF (50-80% smaller at equivalent quality)
  • Responsive sizing: Served 400px images for mobile, 1200px for desktop (not full 4K resolution for all devices)
  • Result: 330KB average page weight (roughly 10x reduction)
  • Performance score: 95/100 despite heavy image usage

The implementation:

<picture>
  <source srcset="hero-400.avif 400w, hero-800.avif 800w, hero-1200.avif 1200w"
          type="image/avif">
  <source srcset="hero-400.webp 400w, hero-800.webp 800w, hero-1200.webp 1200w"
          type="image/webp">
  <img src="hero-800.jpg"
       alt="Hero image"
       width="1200"
       height="800"
       loading="lazy">
</picture>

How browsers handle this: Modern browsers automatically select the best format and size they support. Chrome uses AVIF, Safari uses WebP (AVIF support pending), and older browsers fall back to JPG. Mobile devices get 400px versions, desktop gets 1200px. You write it once, browsers handle the rest.

Tools worth knowing: Squoosh (squoosh.app) for manual conversion with quality preview, or Sharp (Node.js library) for batch processing. Both give you control over quality settings per image.


What makes resources render-blocking?

The problem: External JavaScript files block the browser's main thread during download and execution. Even optimized scripts add 200-500ms of blocking time, which directly affects your Time to Interactive and Total Blocking Time scores.

The solution: Defer JavaScript execution until after initial page render. Load scripts after the page displays content to users.

The Google Analytics consideration: Standard GA4 implementation is the most common performance issue I encounter. The default tracking code blocks rendering and adds approximately 500ms to LCP.

Standard implementation (blocks rendering):

<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script>

Performance-optimized implementation:

<script>
  window.addEventListener('load', function() {
    // Load GA4 after page fully renders
    var script = document.createElement('script');
    script.src = 'https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX';
    document.head.appendChild(script);
  });
</script>

The trade-off: This approach won't track users who leave within the first 2 seconds of page load. In practice, this represents less than 1% of traffic for most sites and is worth the performance improvement.

What to check: Review your <head> section. Any <script> tag without defer or async attributes is blocking. Move it to the page bottom or defer its execution.


How do you prevent cumulative layout shift?

The problem: Content shifting position while the page loads creates a poor user experience and hurts your CLS (Cumulative Layout Shift) score. Common causes include images loading without reserved space, web fonts swapping in, or ads inserting dynamically.

The solution: Reserve space for all content before it loads.

A real example: A professional services site I built maintains a CLS score of 0 (zero layout shift). Here's the approach:

1. Set explicit image dimensions:

<img src="hero.jpg" width="1200" height="800" alt="Hero">
<!-- Browser reserves 1200x800 space before image loads -->

2. Use CSS aspect-ratio for responsive images:

img {
  width: 100%;
  height: auto;
  aspect-ratio: 3/2; /* Maintains space even as viewport changes */
}

3. Configure fonts to display fallbacks immediately:

@font-face {
  font-family: 'CustomFont';
  src: url('/fonts/custom.woff2');
  font-display: swap; /* Show system font immediately, swap when custom font loads */
}

The result: Content positions remain stable throughout the load process. The page feels responsive and professional.

Debugging layout shift: Run PageSpeed Insights and review the filmstrip view. If you see elements jumping position, add explicit dimensions or aspect-ratios to the shifting elements.


What common issues occur during optimization?

Even when following established practices, you might encounter these issues:

"I inlined my CSS but my score dropped"

This happens when inline CSS exceeds 8-10KB. The browser must download the entire HTML file before rendering anything, which delays First Contentful Paint.

Solution: Extract only above-the-fold styles. Identify which CSS is needed for initial viewport rendering, inline only that portion, and load the rest asynchronously:

<link rel="stylesheet" href="/full-styles.css"
      media="print" onload="this.media='all'">

"My AVIF images appear blurry or pixelated"

Default AVIF quality settings are often too aggressive. A quality setting of 50 works for photographs but degrades images containing text or graphics.

Solution: Increase quality to 75-85 for images with text or fine details. Use image conversion tools that show quality previews before batch processing.

"CLS score remains poor despite setting dimensions"

Common culprits beyond images: web fonts loading (text reflows when custom font loads), ads inserting dynamically, or content above images pushing them down during load.

Solutions:

  • Fonts: Use font-display: swap and preload critical font files
  • Images: Always set explicit width and height attributes or use CSS aspect-ratio
  • Dynamic content: Set minimum heights on containers before content populates

"Performance is great on desktop but needs work on mobile"

Mobile devices have slower processors and network connections. What renders quickly on a development machine often struggles on mid-range Android phones over 4G networks. If you're only testing on desktop, you're missing how most users experience your site.

Solution: Always test mobile performance with Chrome DevTools throttling enabled (4x CPU slowdown, Fast 3G network). This simulates realistic mobile conditions and reveals actual user experience. Aim for 90+ on mobile, not just desktop.


How should you test performance?

The challenge: Your site might perform well on your development machine but struggle in real-world conditions. Mobile users on 4G with mid-range phones experience performance very differently than you do on a MacBook Pro with fiber internet.

The testing process:

  1. Run PageSpeed Insights (pagespeed.web.dev) on mobile configuration first
  2. Check Core Web Vitals against targets:
    • LCP (Largest Contentful Paint): under 2.5 seconds
    • TBT (Total Blocking Time): under 200ms
    • CLS (Cumulative Layout Shift): under 0.1
  3. Review the filmstrip: Look for empty frames where nothing renders
  4. Address the largest issue first (typically render-blocking CSS or oversized images)
  5. Re-test and iterate until reaching 90+/100

A perspective on perfection: Don't necessarily chase 100/100 if you're already at 95+. The final 5 points often represent diminishing returns. Consider whether that time is better spent on content, user experience, or other priorities.

Real device testing: Test on actual mobile devices when possible, not just Chrome DevTools simulation. Real hardware reveals issues that simulators miss.


What do these techniques look like in practice?

Examples you can test right now:

I built these sites to demonstrate these techniques in production:

Professional Services Example - zenaith.codecrank.ai

  • Scores: 100/100/100/100 (all four metrics)
  • LCP: 1.8 seconds
  • Techniques used: Inline critical CSS, AVIF images, zero render-blocking scripts, CLS: 0
  • Verification: Click "⚡ PageSpeed Me" in the footer to test live

crAIvings (Restaurant Site) - craivings.codecrank.ai

  • Score: 95/100 (117 pages, 300+ images)
  • Page weight: 330KB average (reduced from 3.1MB)
  • Techniques used: AVIF conversion, responsive images, lazy loading

Mixology (Cocktail Recipes) - mixology.codecrank.ai

  • Score: 99/100
  • Techniques used: Static generation, optimized images, minimal JavaScript

You can test any of these sites yourself. Every site includes a PageSpeed button linking directly to Lighthouse testing. I have nothing to hide—the scores are verifiable.


The Honest Take

Most developers ship sites that "work" and move on. Getting to 100/100 takes additional time and attention to detail that many choose not to invest.

I put PageSpeed buttons on every site I build because the work should speak for itself. If I claim 100/100, you can verify it immediately. If I don't achieve it, I'll explain exactly why (client-requested features, necessary third-party integrations, etc.).

Fair warning: PageSpeed scores can fluctuate by a few points depending on network conditions, server load, and time of day. A site scoring 100/100 might test at 98/100 an hour later. What matters is consistent high performance (90-100 range), not chasing a perfect score every single test.

This transparency is uncommon in web development. Many agencies don't want you testing their work. I built these techniques into my process specifically so performance isn't an afterthought—it's built in from the start.

The results are measurable, verifiable, and reproducible. Some clients care deeply about performance. Some don't. I serve those who do.


What's the realistic time investment?

Optimizing to 100/100 isn't quick the first time through. For a typical site, expect:

  • 1-2 hours: Image optimization (format conversion, resizing, quality testing)
  • 1-2 hours: CSS optimization (critical extraction, inline implementation)
  • 1 hour: Layout shift fixes (dimensions, aspect-ratios, font configuration)
  • 1 hour: Testing and iteration

Total: 4-6 hours for first-time implementation

However: Once you've completed this process for one site, you understand the patterns. Your second site takes approximately 2 hours. Your tenth site takes 30 minutes because you've built the tooling and established the workflow.

Most developers never invest this time because "good enough" ships. But if you care about user experience, SEO performance, and conversion rates, it's worth learning these techniques.


What comes next?

You now understand how to achieve 100/100 PageSpeed scores. You know the techniques, the trade-offs, and the testing approach.

In my next article, I'll examine why performance optimization often gets overlooked in professional web development. I'll share a real case study—a $5,000 professional website scoring 40/100—and explain what affects the cost and quality of web development.

Want to verify these techniques work? Visit any of the sites mentioned above and click "⚡ PageSpeed Me" to test them live. Then consider: what would perfect performance scores mean for your business?

Need help with performance optimization? Visit codecrank.ai to learn about our approach to web development. We build performance optimization into every project from day one.


All performance metrics verified with Google Lighthouse. Sites tested on mobile with 4G throttling and mid-tier device simulation.

Back to Blog