Live gallery
Optimization examples
These are the module's named filters.
The module runs in-process in Apache, nginx and IIS, where you switch each optimization on and off individually — so this gallery shows them one filter at a time. The optimizer worker takes a different path: one always-on pipeline with no per-filter switches, nothing to tune and nothing to break. Same optimization libraries underneath, a different control model — on the worker, read these as what the pipeline does, not a list of toggles.
Read the module docs · See mod_pagespeed optimize a whole site
Served live from demo-httpd-1.1.modpagespeed.com. These
revive the classic open-source mod_pagespeed example showcase; mod_pagespeed was originally
developed at Google, and examples that name Google services (Analytics, AdSense, Fonts)
interoperate with them but imply no affiliation.
Measured
Nov 12, 2026
.
Images
Recompress, resize, inline, sprite, and lazy-load images — usually the largest win.
-
Optimize images
−96% bytesRecompresses images, resizes them to their display size, and inlines small ones.
rewrite_images -
Convert JPEG to AVIF
New in 1.15 −96% bytesRe-encodes photographic JPEGs as AVIF for browsers that accept it.
convert_jpeg_to_avif -
Convert animated GIF to AVIF
New in 1.15 −96% bytesRe-encodes animated GIFs as animated AVIF for browsers that accept it.
convert_to_avif_animated -
Prioritize critical images
New in 1.15Marks the largest above-the-fold image fetchpriority=high so the browser loads it first.
prioritize_critical_images -
Responsive images
−68% bytesServes a srcset so each device downloads an image sized for its screen.
responsive_images -
Resize images for mobile
Serves smaller low-quality placeholders to mobile browsers, then the full image.
resize_mobile_images -
Resize to rendered dimensions
Resizes an image to the dimensions it is actually rendered at on the page.
resize_rendered_image_dimensions -
Inline preview images
Shows an inlined low-quality placeholder until the full image loads.
inline_preview_images -
Lazy-load images
Defers off-screen images until they scroll into the viewport.
lazyload_images -
Sprite images
Combines background images referenced in CSS into a single sprite.
sprite_images -
Deduplicate inlined images
−8% HTMLReplaces repeated inlined images with a reference to the first copy.
dedup_inlined_images
CSS
Minify, combine, inline, and reorder stylesheets to cut requests and unblock rendering.
-
Minify CSS
−18% bytesStrips whitespace and comments, then rewrites CSS to the smallest equivalent form.
rewrite_css -
Combine CSS
−3 requestsCombines multiple stylesheet files into one to cut HTTP requests.
combine_css -
Inline CSS
−3 requestsInlines small external stylesheets to remove a render-blocking request.
inline_css -
Outline CSS
−91% HTMLMoves large inline <style> blocks into external files so they can be cached.
outline_css -
Move CSS to head
Moves stylesheets into the <head> so the browser finds them sooner.
move_css_to_head -
Move CSS above scripts
Reorders CSS ahead of scripts so styles are not blocked by JavaScript.
move_css_above_scripts -
Flatten CSS @imports
Replaces @import rules with the imported CSS to avoid chained requests.
flatten_css_imports -
Convert @import to link
Rewrites a <style> that only @imports into an equivalent <link>.
inline_import_to_link -
Inline Google Fonts CSS
−1 requestInlines the small font-loading CSS that the Google Fonts API serves.
inline_google_font_css -
Fallback CSS URL rewriting
Rewrites URLs inside CSS even when the stylesheet cannot be fully parsed.
fallback_rewrite_css_urls -
Prioritize critical CSS
−4% bytesInlines above-the-fold CSS and loads the rest after first paint.
prioritize_critical_css -
Rewrite style attributes
Applies CSS rewriting to inline style="" attributes.
rewrite_style_attributes -
Rewrite style attributes with url()
Rewrites inline style attributes only when they contain a url() reference.
rewrite_style_attributes_with_url -
Cache-extend images in CSS
Rewrites image URLs inside CSS to content-hashed, cacheable URLs.
rewrite_css_extend_cache -
Recompress images in CSS
Recompresses images referenced from inside stylesheets.
rewrite_css_rewrite_images
JavaScript
Minify, combine, inline, and defer scripts to send fewer bytes and unblock rendering.
-
Minify JavaScript
−26% bytesStrips comments and whitespace from JavaScript.
rewrite_javascript -
Combine JavaScript
−1 requestCombines multiple script files into one to cut HTTP requests.
combine_javascript -
Inline JavaScript
−1 requestInlines small external scripts to remove a request.
inline_javascript -
Outline JavaScript
−99% HTMLMoves large inline <script> blocks into external files so they can be cached.
outline_javascript -
Defer JavaScript
Defers script execution until the page has loaded.
defer_javascript -
Canonicalize JS libraries
Redirects well-known library files to a shared, canonical, cacheable URL.
canonicalize_javascript_libraries -
Async AdSense
−9% HTMLRewrites synchronous Google AdSense tags to the asynchronous format.
make_show_ads_async
HTML
Trim the markup itself — whitespace, comments, redundant attributes and quotes.
-
Collapse whitespace
−15% bytesRemoves redundant whitespace from the HTML.
collapse_whitespace -
Remove comments
−36% bytesStrips HTML comments from the markup.
remove_comments -
Remove quotes
−5% HTMLRemoves quotes around HTML attribute values where they are not required.
remove_quotes -
Elide attributes
−6% bytesRemoves attributes whose value is the browser default.
elide_attributes -
Combine heads
−6% HTMLMerges multiple <head> elements into one.
combine_heads -
Pedantic
Adds default type attributes to script and style tags that omit them.
pedantic -
Add instrumentation
Adds a small client-side beacon that reports real load timings.
add_instrumentation
Caching
Make resources cacheable forever with content-hashed URLs.
-
Extend cache
Rewrites resource URLs to content-hashed names so they cache for a year.
extend_cache -
Extend cache (PDFs)
Applies cache extension to linked PDF files.
extend_cache_pdfs -
Local storage cache
−1 requestStores inlined CSS and images in the browser's local storage for repeat visits.
local_storage_cache -
Optimize for bandwidth
−80% bytesOptimizes resources in place without changing their URLs — safe for any cache.
optimize_for_bandwidth
Resources
Resource hints and URL rewriting that start fetches earlier and cut round-trips.
-
Insert DNS prefetch
Injects <link rel="dns-prefetch"> hints so the browser resolves DNS early.
insert_dns_prefetch -
Preload subresources
Emits preload hints for CSS and JavaScript the page will need.
hint_preload_subresources -
Insert speculation rules
New in 1.15Injects a speculation-rules script so supporting browsers prefetch same-origin links a visitor is likely to open next.
insert_speculation_rules -
Trim URLs
−16% HTMLShortens resource URLs to relative form where it is safe to do so.
trim_urls -
Proxy external resources
−17% bytesProxies and optimizes trusted resources hosted on domains without PageSpeed.
map_proxy_domain