Skip to main content
ModPageSpeed 2.0: AVIF, WebP, and critical CSS — up to 69% less page weight on the live demo

PageSpeed filters

Documentation

PageSpeed filters are the named optimizations in mod_pagespeed. Each filter performs one transformation on a response as it passes through your server: recompress images, minify and combine CSS and JavaScript, inline critical CSS, extend cache lifetimes. The table below lists every filter in mod_pagespeed 1.15.

ModPageSpeed 2.0 is an independent rebuild with a different optimization pipeline. It applies image optimization (WebP, AVIF, learned quality), critical CSS, and caching, configured through the worker rather than this filter list. See the ModPageSpeed 2.0 configuration guide.

Looking for the Google PageSpeed Insights score at pagespeed.web.dev? That is Google’s online scoring tool. This page documents the optimization filters that do the work, not the score. To measure a URL yourself, use Analyze.

Enable filters individually with EnableFilters, or activate them in groups via RewriteLevel presets (CoreFilters, OptimizeForBandwidth). For how to enable, disable, and scope filters per location, see the mod_pagespeed 1.15 filter selection reference.

The full list of PageSpeed filters

Every filter, what it does, and which content type it transforms. Each name links to its directive reference.

Filter What it does Category
convert_gif_to_png Converts GIF to PNG Image
convert_jpeg_to_progressive Converts large JPEGs to progressive format Image
convert_jpeg_to_webp Converts JPEG to WebP for capable browsers Image
convert_png_to_jpeg Converts PNG to JPEG when no transparency Image
convert_to_webp_animated Converts animated GIF to WebP Image
convert_to_webp_lossless Converts PNG/GIF to lossless WebP Image
dedup_inlined_images Replaces repeated inlined images with JS reference Image
in_place_optimize_for_browser Browser-specific in-place optimization Image
inline_images Inlines small images as data: URIs Image
inline_preview_images Inserts low-quality image placeholders Image
insert_image_dimensions Adds width and height attributes to <img> tags Image
jpeg_sampling Reduces chroma sampling to 4:2:0 Image
lazyload_images Defers offscreen image loading Image
recompress_images Lossless image recompression Image
recompress_jpeg JPEG-specific recompression Image
recompress_png PNG-specific recompression Image
recompress_webp WebP-specific recompression Image
resize_images Resizes images to match <img> dimensions Image
resize_mobile_images Smaller placeholders for mobile Image
resize_rendered_image_dimensions Resizes to rendered dimensions Image
responsive_images Generates srcset for multiple resolutions Image
rewrite_images Master image optimization (enables sub-filters) Image
sprite_images Combines CSS background images into sprites Image
strip_image_color_profile Removes ICC color profiles Image
strip_image_meta_data Removes EXIF and other metadata Image
combine_css Combines multiple CSS files into one CSS
fallback_rewrite_css_urls Rewrites resource URLs in unparseable CSS CSS
flatten_css_imports Inlines CSS @import rules CSS
inline_css Inlines small external CSS into HTML CSS
inline_google_font_css Inlines Google Fonts CSS CSS
inline_import_to_link Converts <style>@import</style> to <link> CSS
move_css_above_scripts Moves CSS <link> above <script> tags CSS
move_css_to_head Moves CSS <link> into <head> CSS
outline_css Externalizes large inline CSS blocks CSS
prioritize_critical_css Inlines above-fold CSS, defers the rest CSS
rewrite_css Minifies CSS, rewrites embedded URLs CSS
rewrite_style_attributes Applies CSS rewriting to inline style attributes CSS
rewrite_style_attributes_with_url Same, only for styles containing url() CSS
combine_javascript Combines multiple JS files into one JavaScript
defer_javascript Defers JS execution until after page load JavaScript
include_js_source_maps Preserves JavaScript source maps JavaScript
inline_javascript Inlines small external JS into HTML JavaScript
outline_javascript Externalizes large inline JS blocks JavaScript
rewrite_javascript Minifies JavaScript JavaScript
rewrite_javascript_external Minifies external JavaScript files JavaScript
rewrite_javascript_inline Minifies inline JavaScript JavaScript
add_head Adds <head> element if missing HTML
add_instrumentation Injects JavaScript to measure page load time HTML
collapse_whitespace Removes excess whitespace from HTML HTML
combine_heads Merges multiple <head> elements HTML
convert_meta_tags Adds HTTP headers from <meta http-equiv> tags HTML
elide_attributes Removes default-value HTML attributes HTML
hint_preload_subresources Adds Link: rel=preload headers HTML
insert_dns_prefetch Adds <link rel=dns-prefetch> for third-party domains HTML
pedantic Adds type attributes for HTML4 validation HTML
remove_comments Strips HTML comments HTML
remove_quotes Removes unnecessary attribute quotes HTML
trim_urls Shortens URLs relative to base URL HTML
extend_cache Content-hashed URLs with 1-year browser cache Caching
extend_cache_pdfs Cache extension for PDF links Caching
local_storage_cache Caches inlined resources in localStorage Caching
rewrite_domains Applies domain mappings to original resources Caching

For the full directive-level reference (parameters, defaults, CoreFilter and OptimizeForBandwidth membership, and safety notes), see the per-filter directive reference.