Configuring PageSpeed Filters
PageSpeed offers three base levels of optimization:
CoreFilters set contains filters that Google's PageSpeed team believes are safe for most web sites. The
OptimizeForBandwidth setting provides a stronger guarantee of safety and is suitable as a default setting for use with sites that are not aware of PageSpeed. The default level is
CoreFilters, to disable use
Enabling, Disabling And Forbidding Specific Filters
EnableFilters configuration file directive allows specification of one or more filters by name, separated by commas. You can use any number of
EnableFilters directives, each of which can contain multiple filter names separated by commas. For example:
To turn off specific filters in the core set, specify:
pagespeed DisableFilters filtera,filterb
For example, if you want to use the core set of filters, but specifically disable
combine_css, you can use:
pagespeed DisableFilters rewrite_images,combine_css
To turn off specific filters and forbid them from being turned on by query parameters, request headers or in location-specific configuration , specify (for example):
You can use any number of the
ForbidFilters directives, each of which can contain multiple filter names separated by commas.
Forbidding All Disabled Filters
You can enable filters for a specific request using either query parameters or request headers, and you can enable filters in sub-directories using the
EnableFilters directive if the server module supports configuring that.
In both cases you can enable filters that are disabled or not explicitly enabled in the configuration file, however there are situations where this is undesirable, such as when a filter has been expressly disabled because it breaks a page, or because a filter imposes too great a load on the server.
All disabled filters can be forced off with:
pagespeed ForbidAllDisabledFilters true
Note that in this context disabled filters means all filters that are not enabled by the
This directive can be used in location-specific configuration sections.
Checking Which Filters Are Enabled
If you want to see exactly which filters are enabled on a virtual host, you can do so by going to that host's admin or statistics page.
Tuning the Filters
Once the rewriters are selected, some of them may also be tuned. These parameters control the inlining and outlining thresholds of various resources.
CssFlattenMaxBytes 102400 (was 2048 prior to PageSpeed 220.127.116.11) CssImageInlineMaxBytes 0 CssInlineMaxBytes 2048 CssOutlineMinBytes 3000 ImageInlineMaxBytes 3072 ImageLimitOptimizedPercent 100 ImageLimitResizeAreaPercent 100 ImageRecompressionQuality 85 ImageResolutionLimitBytes 32000000 JpegRecompressionQuality -1 JpegRecompressionQualityForSmallScreens 70 JpegNumProgressiveScans -1 JpegNumProgressiveScansForSmallScreens -1 WebpRecompressionQuality 80 WebpRecompressionQualityForSmallScreens 70 JsInlineMaxBytes 2048 JsOutlineMinBytes 3000 MaxInlinedPreviewImagesIndex -1 MinImageSizeLowResolutionBytes 3072 RetainComment "[WILDCARD PATTERN]" RewriteRandomDropPercentage 0
Note: The default settings are reasonable and intuitive, but as of this writing (December 2011) have not been experimentally tuned.
These directives can be used in location-specific configuration sections.
The PageSpeed code base contains a number of additional filters whose use is unsupported. Some of these are experimental; note that using experimental filters is likely to result in crashes or site breakage. Others are used for debugging specific problems with PageSpeed:
|Debugging filter name||Brief Description|
||Removes all script tags from the document.|