Skip to content
← Back to blog
by rn00m

PSI - Pagespeed Insights Optimization


The Core Problem: The Render-Blocking Global CSS File

  • File: _astro/BaseLayout.BKuHRjxn.css [1
  • Transfer Size: 8.9 KiB [1
  • Duration: 150 ms [1]

Even though 8.9 KiB is a very small file size, because it is linked as a standard external stylesheet in your HTML header, the browser stops everything when it sees it. It refuses to display a single pixel of your website, including your preloaded hero image, until it finishes downloading and parsing this CSS file. This delay directly causes that 300 ms Total Blocking Time penalty on mobile.

The Fix: Inlining Critical Base CSS

To eliminate this render-blocking penalty and move closer to a perfect score, you should tell Astro to inject your core layout CSS directly into your HTML document as an inline

// astro.config.mjs
import { defineConfig } from 'astro/config';

export default defineConfig({
  vite: {
    build: {
      // Tells Vite/Astro to inline small CSS chunks directly into the HTML document
      assetsInlineLimit: 10240, // 10 KiB (your 8.9 KiB file falls right under this)
    }
  },
  // If you are using Astro's native style settings:
  build: {
    inlineStylesheets: 'always' // Forces styles to inline, eliminating the external network fetch
  }
});