open source · Apache-2.0
mod_pagespeed, the PageSpeed module for nginx and Apache . Lighthouse 56 to 90. On your own servers.
mod_pagespeed transcodes images to AVIF, minifies CSS and JS, and injects critical CSS — optimized off the request path, served from cache by your own nginx or Apache.
No proxy, no CDN, nothing third-party in your request path. Running IIS or ASP.NET Core? see the IIS and ASP.NET Core packages
Already running mod_pagespeed 1.x or ngx_pagespeed? Your pagespeed directives carry over. Upgrade guide
Readout · demo store
see it live56 to 90
Lighthouse performance score
1.8s to 0.8s
page load, cut in half (simulated 3G)
−76%
product image, JPEG → AVIF
0
third parties in the request path
- In production
- The optimization core behind 230,000+ live sites (BuiltWith, May 2026) — maintained by We-Amp.
- Free to run
- Open source under the Apache License 2.0 — free in development and in production.
- What is for sale
- No per-image or per-request metering like a CDN. Support from the people who build it is what’s for sale. See support plans
- Who builds it
- Built by We-Amp — the team that helped build ngx_pagespeed and maintains mod_pagespeed today.
mod_pagespeed is developed by We-Amp B.V. and is not affiliated with or endorsed by Google. mod_pagespeed is an open-source project originally developed at Google.
01 Procedure
Install. Configure. Verify.
-
STEP 1
Install
aptordnfinstall the signed package for Apache or nginx. The optimizer worker installs alongside. -
STEP 2
Tell it what to optimize
Keeps the mod_pagespeed 1.14/1.15 directives. Enable filters and set the cache path.
-
STEP 3
Check the response headers
curl -I your-site | grep -iE 'page-?speed'. A PageSpeed response header confirms the module is active.
curl -fsSL https://packages.modpagespeed.com/install.sh | sudo sh
sudo apt-get install pagespeed-optimizer
sudo apt-get install nginx-module-pagespeed
curl -fsSL https://packages.modpagespeed.com/install.sh | sudo sh
sudo apt-get install mod-pagespeed
One product: the module you know, plus the optimizer worker.
Pick by your stack
- Apache native module + worker → mod_pagespeed
- nginx native module, and module + worker in the reverse-proxy deployment → mod_pagespeed
- IIS / Windows Server → the IIS module — the IIS package ships as a signed installer on the mod_pagespeed GitHub release
- ASP.NET Core → the ASP.NET Core middleware (WeAmp.PageSpeed.AspNetCore)
- WordPress → the WordPress plugin
- cPanel → the cPanel guide
Every integration shares the same optimization core; mod_pagespeed keeps the 1.14/1.15 directives, so existing configuration carries over.
mod_pagespeed
One product, two parts — open source under the Apache License 2.0
- Native in-process module — no proxy hop; drop-in for your pagespeed.conf
- Optimizer worker off the request path — ML quality + SSIMULACRA2 verification
- Classic filters: combine, sprite, IPRO, domain mapping
-
Built-in
/pagespeed_admin/console - Serving straight from the variant-aware cache — no re-optimization on the request path
- Transform packs: the free edge-SEO pack lets you set canonicals, titles, descriptions, hreflang and JSON-LD at serve time, starting in report mode. See the packs.
02 Running on our own sites
Running on our own sites
We run every We-Amp site through it.
We run our own sites, this page included, through mod_pagespeed — the binary serving this page is the binary we ship. Same Cyclone cache. Check the response headers. On our own demo sites we measure up to 69% smaller pages.
HTTP/1.1 200
content-type: text/html
content-length: 32688
x-mod-pagespeed: 2.8.1
vary: User-Agent,Accept-Encoding,Save-Data
content-encoding: gzip
cache-control: max-age=0, no-cache
captured 2026-11-09
In the reverse-proxy deployment, the module adds
x-pagespeed: HIT
or
x-pagespeed: MISS
to the response.
03 Signal path
The worker optimizes off the request path. The module serves from cache.
x-pagespeed: HIT
hash lookup + mmap pointer
x-pagespeed: MISS
original served, worker queued
04 Specification
What runs on your server.
images ≤ 37 variants
One decode pass, up to 37 variants out
Automatic WebP and AVIF transcoding with viewport-aware resizing. Every variant is verified against the original with SSIMULACRA2 before it reaches the cache, using ML-predicted per-format quality. The optimizer worker can auto-vectorize eligible images to SVG. Content-aware compression adapts to photos, screenshots, and illustrations differently.
css 103 Early Hints
Render-blocking CSS eliminated
Heuristic-based critical CSS extraction and injection. CSS/JS minification. Early Hints (103) for preloading. No headless browser required. Optional browser pipeline for Lighthouse validation, waterfall capture, and visual comparison.
cache hash + mmap
Cache hits are a pointer, not a pipeline
The Cyclone cache serves optimized content from a memory-mapped file — a hash lookup and a pointer, no re-optimization on the request path.
egress 0 third parties
Self-hosted by design
Visitor data never leaves your origin, and nothing in the request path talks to us. Open source you can audit, running entirely on infrastructure you control.
js fallback: original
Deliberately conservative
JS minification strips whitespace and comments only. No variable renaming, no AST transforms. The design falls back to the original when an optimization step fails.
variants AVIF · WebP · DPR · Save-Data
The right bytes for every client
Per-URL cache variants tuned to each client — image format (AVIF / WebP / original), viewport size, pixel density, Save-Data, and pre-compressed encoding — so each request gets the smallest appropriate bytes off the cache.
05 Evaluation
Before it goes in front of production traffic.
- mod_pagespeed is free. What does We-Amp sell?
- Support. The original mod_pagespeed and ngx_pagespeed are no longer actively developed; the current mod_pagespeed is the maintained, open-source (Apache-2.0) continuation: the same directives and filters, with security fixes and a current toolchain, plus a separate optimizer worker with variant-aware caching that serves optimized variants straight from cache and optimizes off the request path. The software is free; what We-Amp sells is support plans from the people who build it.
- Does it add latency?
- No. On cache hit, serving is a hash lookup and an mmap pointer. On cache miss, the original content gets served while the worker optimizes in the background.
- Can it break my site?
- Transforms are deliberately conservative — JS minification strips whitespace and comments, no variable renaming — and the design falls back to your original content when an optimization step fails. Edge cases exist: test on staging, then disable any path, URL pattern, or transform type with one line of config.
- Why not just use Cloudflare?
- CDN-based optimization routes your traffic through a third-party proxy. mod_pagespeed runs on your servers — visitor data never leaves your origin, and nothing third-party sits in your request path.
- How is this different from a CDN optimizer (Cloudflare Mirage, Bunny Optimizer, Fastly IO)?
- Those rewrite assets at the edge, on infrastructure you don't control, with cache state you can't inspect. mod_pagespeed runs on your origin, so your rewrites carry your URLs, your headers, your cache policy. Use both — we optimize the origin, the CDN accelerates the delivery.
- How is this different from a build-time optimizer (Astro, Next.js Image, Vite plugins)?
- Those require a modern build pipeline you own end-to-end. We win when your build is owned by your CMS (WordPress, Magento, ASP.NET Framework) or your content is dynamic. If you already ship through a modern JS framework's asset pipeline, you may not need us.
Comparing against a CDN optimizer or a build-time pipeline? See the side-by-side comparisons
06 The lineage
The optimization core behind 230,000+ live sites — now maintained by We-Amp.
230,000+
live sites run mod_pagespeed today
1.9 million
sites across its history
Usage data: BuiltWith, May 2026 (231,341 live; 1,900,000+ historical).
Further reading
Docs
Configuration
Configuration options for Apache and nginx: directives, cache modes, worker settings, and per-location overrides.
Read the docs
Docs
PageSpeed filters reference
Every rewrite filter and what it does: image transcoding, CSS and JS minification, combining, spriting, IPRO, and domain mapping.
Read the docs
Blog
Image optimization cost: self-hosted vs CDN (2026)
Cost comparison at 100K, 1M, and 10M monthly image requests — with break-even analysis against self-hosted optimization.
Read post
Blog
mod_pagespeed Alternatives in 2026
The original mod_pagespeed and ngx_pagespeed — developed at Google — are no longer actively developed. Here is where to go instead.
Read post
Free to install and run. Start today.
Open source under the Apache License 2.0, on your own servers. No per-request fees. No bandwidth metering.
Support from the people who build it is what’s for sale.
Sponsorship on GitHub funds the ongoing work. Sponsor on GitHub