PageSpeed Filters
PageSpeed improves web page latency by changing the resources on that web page to implement web performance best practices. Each sort of change that PageSpeed makes is embodied in a filter. The filters are run in a pre-defined order, but can be enabled and disabled in the server configuration file.
Some filters simply alter HTML content, such as removing excess whitespace, attributes, or attribute values that will be ignored.
Other filters change references to CSS, JavaScript, or images to point to more optimized versions, because they:
- are smaller,
- combine multiple files into one, and
- extend the cache lifetime
Categories of filters
Filters are of many categories that fit under performance best practices. The current set of filters fits in these categories as follows:
Optimize Caching
- Canonicalize JavaScript Libraries
- Extend Cache
- Extend Cache PDFs
- Local Storage Cache
- Outline CSS
- Outline JavaScript
Minimize Round Trip Times
- Combine CSS
- Flatten CSS @imports
- Inline CSS
- Inline Google Fonts API CSS
- Combine JavaScript
- Inline JavaScript
- Move CSS Above Scripts
- Configuration file directive to shard domains
- Sprite Images
- Pre-Resolve DNS
Minimize Request Overhead
Minimize Payload Size
- Collapse Whitespace
- Combine Heads
- Elide Attributes
- Minify JavaScript
- Optimize Images
- Prioritize Critical CSS
- Deduplicate Inlined Images
- Remove Comments
- Remove Quotes
- Rewrite CSS
- Rewrite Style Attributes
- Trim URLs
Optimize Browser Rendering
- Convert Meta Tags
- Defer Javascript
- Hint Resource Preloading
- Inline Preview Images
- Lazily Load Images
- Make Images Responsive
- Move CSS to Head
- Optimize Images
- Convert JPEG to Progressive
- Rewrite Style Attributes
Other
- Add Head
- Add Instrumentation
- Include JavaScript Source Maps
- Inline @import to Link
- Insert Google Analytics Snippet
- Make Google AdSense Async
- Make Google Analytics Async
- Pedantic
- Run Experiment
In some cases, a filter such as 'Optimize Images' helps both minimize request overhead and optimize browser rendering.