Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Astro-specific performance optimizations for 95+ Lighthouse scores. Covers critical CSS inlining, compression, font loading, and LCP optimization. Use when optimizing Astro site performance, improving Astro Lighthouse scores, or configuring astro-critters. Do NOT use for non-Astro sites (use perf-web-optimization or core-web-vitals) or running Lighthouse audits (use perf-lighthouse).
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | -28% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 20% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 8% | 0% |
| case-10 | ✗→✓ | ▲ Improved | -39% | 0% |
| case-11 | ✗→✓ | ▲ Improved | -30% | 0% |
Astro-specific optimizations for 95+ Lighthouse scores.
bashnpm install astro-critters @playform/compress
js// astro.config.mjs import { defineConfig } from 'astro/config' import critters from 'astro-critters' import compress from '@playform/compress' export default defineConfig({ integrations: [ critters(), compress({ CSS: true, HTML: true, JavaScript: true, Image: false, SVG: false, }), ], })
Automatically extracts and inlines critical CSS. No configuration needed.
What it does:
Build output shows what it inlined:
Inlined 40.70 kB (80% of original 50.50 kB) of _astro/index.xxx.css.Minifies HTML, CSS, and JavaScript in the final build.
Options:
jscompress({ CSS: true, // Minify CSS HTML: true, // Minify HTML JavaScript: true, // Minify JS Image: false, // Skip if using external image optimization SVG: false, // Skip if SVGs are already optimized })
Structure your Layout.astro for performance:
astro--- import '../styles/global.css' --- <!doctype html> <html lang="pt-BR"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <!-- Font fallback (prevents FOIT) --> <style> @font-face { font-family: 'Inter'; font-display: swap; src: local('Inter'); } </style> <!-- Non-blocking Google Fonts --> <link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap" media="print" onload="this.media='all'" /> <noscript> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap"> </noscript> <!-- Preload LCP images --> <link rel="preload" as="image" href="/hero.png" fetchpriority="high"> <title>{title}</title> <!-- Defer third-party scripts --> <script> let loaded = false; function loadAnalytics() { if (loaded) return; loaded = true; // Load GTM, analytics, etc. } ['scroll', 'click', 'touchstart'].forEach(e => { document.addEventListener(e, loadAnalytics, { once: true, passive: true }); }); setTimeout(loadAnalytics, 5000); </script> </head> <body> <slot /> </body> </html>
bashnpx lighthouse https://your-site.com --preset=perf --form-factor=mobile
See also:
astro-critters installed and configured@playform/compress installed and configuredmedia="print" onload pattern<head>Other measured skills in the registry, with their headline benchmark lift.