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

Filters Overview

All mod_pagespeed 1.15 optimization filters organized by category. Image, CSS, JavaScript, HTML, and caching filters with quick descriptions.

On this page

mod_pagespeed 1.15 organizes its optimizations as filters. Each filter performs a specific transformation on HTML responses as they pass through the web server. Filters can be enabled individually with directives or activated in groups via RewriteLevel presets (CoreFilters, OptimizeForBandwidth). See filter selection for configuration details.

See these filters live. The optimization examples gallery runs each filter on a small page through Apache + mod_pagespeed 1.15 — original vs optimized, side by side, with the source diff and measured byte/request savings.

Image filters

Image filters reduce image payload by recompressing, converting to more efficient formats, resizing to rendered dimensions, and inlining small images as data URIs. On image-heavy pages, these filters usually account for the bulk of the bytes saved.

Full reference: Image filters

CSS filters

CSS filters reduce stylesheet size and the number of HTTP requests required to load them. They minify CSS, combine separate stylesheets into fewer files, inline small stylesheets directly into the HTML, and flatten @import chains.

Full reference: CSS filters

JavaScript filters

JavaScript filters reduce script size and control when scripts execute. They minify source, combine separate scripts to reduce round trips, and defer execution until the page has loaded.

Full reference: JavaScript filters

HTML filters

HTML filters optimize the HTML document itself. They remove unnecessary whitespace and comments, add performance hints such as DNS prefetch and preload headers, and fix structural issues in the document.

Full reference: HTML filters

Caching and URL filters

Caching filters extend browser cache lifetimes by rewriting resource URLs to include content hashes. This allows setting long Cache-Control max-age values while ensuring that browsers fetch updated resources when content changes.

  • extend_cache (core) — rewrite CSS, JavaScript, and image URLs with content-based hashes and set long TTLs
  • extend_cache_pdfs — apply the same content-hashed URL strategy to PDF links

Full reference: Caching and URL filters

Quick reference

For a complete table of all 62 filters with their default levels and descriptions, see the filter reference.

Deprecated filters

Certain filters that targeted Google-specific services remain available for backward compatibility but are not recommended:

  • insert_ga — Google Analytics snippet injection
  • make_google_analytics_async — asynchronous GA conversion
  • canonicalize_javascript_libraries — rewrite to Google Hosted Libraries CDN

The services these filters target have been retired or significantly changed. New deployments should not enable them.