Skip to content

Introduction

Pageflare is a post-build optimizer for static sites. After your site generator (Astro, Next.js, Hugo, WordPress, or any other tool) produces its output, pageflare processes those files and applies a suite of performance optimizations — all without touching your source code.

The result: higher PageSpeed / Lighthouse scores, smaller payloads, and better Core Web Vitals, in a single CLI command.

Pageflare reads your site’s output directory and rewrites HTML, CSS, JavaScript, and font references in place. It does not change your source files and does not require a build-step plugin.

  • HTML minification — strips whitespace, comments, and redundant attributes.
  • CSS minification — removes unused rules, collapses shorthand properties, and eliminates dead code.
  • JS minification — minifies and tree-shakes JavaScript bundles.
  • JS deferral — moves render-blocking <script> tags to the end of <body> or adds defer/async attributes.
  • Lazy loading — adds loading="lazy" to below-the-fold images and iframes.
  • Preconnect hints — injects <link rel="preconnect"> for third-party origins detected in the markup.
  • Image dimensions — reads each <img> and adds missing width/height attributes to prevent layout shift (CLS).
  • Platform images — rewrites image URLs to use platform-native image CDNs (Cloudflare Images, Vercel Image Optimization) when available. (Pro)
  • Defer background images — converts CSS background-image declarations to lazy-loaded equivalents. (Pro)
  • Font display swap — adds font-display: swap to all @font-face declarations, eliminating invisible-text flash (FOIT).
  • Self-host Google Fonts — downloads Google Fonts at build time and rewrites references to serve them from your own origin. (Pro)
  • Unicode-range subsetting — adds unicode-range descriptors so browsers only download character subsets they need. (Pro)
  • Critical CSS — extracts and inlines above-the-fold CSS, then lazy-loads the rest. (Pro)
  • SPA mode — enables client-side navigation with prefetching via the Navigation API. (Pro)
  • Speculation rules — injects the Speculation Rules API for instant page transitions. (Pro)
  • YouTube facades — replaces <iframe> YouTube embeds with lightweight click-to-load facades. (Pro)
  • WordPress bloat removal — strips WP-specific render-blocking scripts and styles (emoji JS, query string versioning, etc.). (Pro)
  • Hash filenames — content-hashes asset filenames for aggressive long-term caching. (Pro)
Feature Free Pro
HTML minification Strips whitespace and redundant attributes from HTML files.
CSS minification Removes unused rules and collapses shorthand properties.
JS minification Minifies and tree-shakes JavaScript bundles.
JS deferral Adds defer/async to render-blocking scripts.
Lazy load images Adds loading="lazy" to below-the-fold images.
Lazy load iframes Adds loading="lazy" to below-the-fold iframes.
Image dimensions Reads image files and injects missing width/height attributes.
Font display swap Adds font-display: swap to all @font-face rules.
Preconnect hints Injects <link rel="preconnect"> for detected third-party origins.
Critical CSS Extracts and inlines above-the-fold CSS for faster first paint.
Self-host Google Fonts Downloads and serves fonts from your own origin.
Unicode-range subsetting Adds unicode-range so browsers only fetch needed character sets.
SPA mode Enables client-side navigation with prefetching.
Speculation rules Injects Speculation Rules API for instant page transitions.
YouTube facades Replaces iframe embeds with lightweight click-to-load facades.
WordPress bloat removal Removes WP-specific render-blocking scripts and styles.
Platform images Rewrites image URLs to use platform-native CDNs.
Defer background images Lazy-loads CSS background-image declarations.
Hash filenames Content-hashes asset filenames for long-term caching.
  • Quick Start — be up and running in two minutes.
  • Installation — all installation methods including npm, Homebrew, curl, and Docker.
  • First Optimization — a guided walkthrough of your first real run.
  • Platform Guides — integration instructions for Cloudflare Pages, Vercel, WordPress, and more.