Configuration reference: Apache and nginx directives
Last updated Edit this page View as Markdown
Every mod_pagespeed 2.1 directive for the native Apache and nginx module, generated from the source: syntax, default, context and description.
On this page
mod_pagespeed is configured with directives in the web server’s own configuration. This page lists every one of them, generated from the module’s source so the list is the list the shipped module accepts: for each directive the syntax on Apache and nginx, the default, the contexts it may appear in and the module’s own description, grouped by area. It starts with where the configuration lives and the smallest configuration that works.
Where the configuration lives
nginx has no separate file: pagespeed directives go into nginx.conf (or a
file it includes) in the http, server or location block. The package
auto-enables the module’s load_module line on a stock nginx; every directive
is written as pagespeed Name value;.
The package drops pagespeed.conf into /etc/apache2/mods-available/ (Debian,
Ubuntu) or /etc/httpd/conf.d/ (RHEL, AlmaLinux, Rocky) and loads the module.
Edit that file, or put directives in a virtual host, a <Directory> or
<Location> block, or .htaccess; every directive is written as
ModPagespeedName value.
The installer registers the module and reads pagespeed.config, a flat text
file with one directive per line, from the website root (site-level) and from
%ProgramData%\We-Amp\PageSpeed\pagespeed.config (server-level); site-level
settings override server-level ones. If pagespeed.config is not found the
module falls back to iiswebspeed.config, the filename of IISpeed installs.
Directives are written as pagespeed Name value without a semicolon; the
ModPagespeed and iispeed prefixes are accepted for compatibility. See
IIS configuration for match rules and the file
format.
Minimal working configuration
load_module modules/ngx_pagespeed_module.so; # Enterprise Linux: /usr/lib64/nginx/modules/ngx_pagespeed_module.so
http {
server {
pagespeed on;
pagespeed FileCachePath /var/cache/ngx_pagespeed;
# Let the module serve its own resources.
location ~ "\.pagespeed\.([a-z]\.)?[a-z]{2}\.[^.]{10}\.[^.]+" {
add_header "" "";
}
location ~ "^/pagespeed_static/" { }
location ~ "^/ngx_pagespeed_beacon$" { }
}
}
ModPagespeed on
ModPagespeedFileCachePath /var/cache/mod_pagespeed/
The packaged pagespeed.conf already contains both, so a fresh install
optimizes with RewriteLevel CoreFilters without any edit.
pagespeed on
With that in place the module runs the CoreFilters set. Everything below is optional: pick a different rewrite level, add or remove filters, and tune the directives of the area you care about. To see which filters your own pages would benefit from, run them through a PageSpeed Insights test.
How to read the reference
- Syntax shows the Apache spelling (
ModPagespeedName …) and the nginx spelling (pagespeed Name …;). IIS uses the nginx spelling without the semicolon. Placeholders:on|offis a boolean (true/falsealso work),numberan integer,valuea string,wildcarda URL pattern with*. - Default is the value compiled into the module;
(empty)means unset, and—that the directive has no value of its own. - Context lists where the directive may appear. On Apache: the server
config, a
<VirtualHost>, a<Directory>/<Location>block,.htaccess. On nginx: thehttp,serverandlocationblocks. “Also per request” marks the options that can also be set on a single request with aPageSpeed…query parameter or header. - Platform appears when a directive exists on one server only. An option whose block says the source carries no help text is accepted by nginx but is not registered as an Apache directive.
- A since version is not shown: the module source does not record the release a directive first appeared in. Additions are listed per release in the release notes.
The nginx versions each shape runs on are in one table on the worker and reverse-proxy page.
Module states
The module switch, pagespeed / ModPagespeed, takes three
states:
| State | Behavior |
|---|---|
on | Full optimization. The module rewrites HTML and serves optimized resources. |
standby | Serves previously optimized .pagespeed. resources and responds to query-parameter requests, but does not optimize new traffic. Use this to drain optimized resources before fully disabling the module. |
unplugged | Fully disabled. The module does not intercept any requests. This state can only be set at the top level or within a virtual host block, not in directory-level configuration. |
pagespeed standby;
On nginx, pagespeed off; is an alias for unplugged.
ModPagespeed standby
pagespeed standby
Scoping directives
Directives can be scoped to parts of a site; a value set at a higher level is inherited by the blocks inside it. The scoping mechanisms differ per server.
Apache supports configuration at several levels:
pagespeed.conf— Global defaults that apply to all virtual hosts.<VirtualHost>— Per-site overrides.<Directory>and<Location>— Target specific filesystem paths or URL paths..htaccess— Per-directory configuration placed in the document root or subdirectories.
.htaccess configuration is re-read on every request, which adds per-request
overhead. For high-traffic sites, prefer <Directory> or <Location> blocks in
the server configuration.
<Location /images/>
ModPagespeedDisableFilters convert_jpeg_to_webp
</Location>
In nginx, use server and location blocks to scope directives:
server {
pagespeed on;
location /static/ {
pagespeed off;
}
}
Directives set in a server block apply to all locations within that server
unless overridden by a more specific location block. Directives whose context
is http only are global and are rejected elsewhere.
See IIS configuration for IIS path- and hostname-based scoping.
Virtual hosts
Each virtual host can carry its own mod_pagespeed configuration. Directives set at the global level serve as defaults; virtual host configuration overrides them.
One requirement: HTML pages and the optimized resources they reference must share the same configuration options. If a virtual host serves HTML that references resources optimized under a different set of options, the resources may not be found or may be re-optimized unnecessarily.
server {
server_name site-a.example.com;
pagespeed on;
pagespeed EnableFilters rewrite_images;
}
server {
server_name site-b.example.com;
pagespeed on;
pagespeed EnableFilters collapse_whitespace;
}
<VirtualHost *:80>
ServerName site-a.example.com
ModPagespeed on
ModPagespeedEnableFilters rewrite_images
</VirtualHost>
<VirtualHost *:80>
ServerName site-b.example.com
ModPagespeed on
ModPagespeedEnableFilters collapse_whitespace
</VirtualHost>
Place a pagespeed.config file in each website’s root directory. Each file can
carry its own set of directives:
Site A (C:\inetpub\site-a\pagespeed.config):
pagespeed on
pagespeed EnableFilters rewrite_images
Site B (C:\inetpub\site-b\pagespeed.config):
pagespeed on
pagespeed EnableFilters collapse_whitespace
Alternatively, use match rules in the server-level config to scope directives by hostname:
hostname: ^site-a\.example\.com$
pagespeed EnableFilters rewrite_images
hostname: ^site-b\.example\.com$
pagespeed EnableFilters collapse_whitespace
Directive reference
Every directive the module registers, generated from the source at the release
the source pin
names, grouped by area. Since v1.15.0+r18 configuration validation is strict:
out-of-range values for bounded options (image quality levels, progressive JPEG
scan counts, HttpCacheCompressionLevel, RewriteRandomDropPercentage) fail
configuration load instead of being silently accepted, an invalid filter name in
?PageSpeedFilters= rejects the whole query, and directive matching is
case-consistent. A configuration that loaded on an earlier revision may need its
values corrected when upgrading.
Areas: Enabling and filter selection (13) · Request handling and policy (33) · In-place resource optimization (14) · Domains and URLs (26) · Optimizer worker (4) · Bot authentication and licensing (19) · Statistics, console and logging (31) · Images (42) · CSS (9) · JavaScript (10) · Caching (46) · Fetching and origins (19) · HTML rewriting and page hints (11) · Threads and limits (2) · Experiments and analytics (11) · Deprecated and ignored (28).
Enabling and filter selection
Allow, DisableFilters, Disallow, EnableAggressiveRewritersForMobile, EnableFilters, EnableRewriting, ForbidAllDisabledFilters, ForbidFilters, ModPagespeed, RewriteDeadlinePerFlushMs, RewriteLevel, RewriteRandomDropPercentage, RewriteUncacheableResources
Allow
- Syntax:
ModPagespeedAllow wildcard(Apache) ·pagespeed Allow wildcard;(nginx) - Default: —
- Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Allows optimization of resources whose URL matches the wildcard. Later Allow and Disallow directives override earlier ones.
DisableFilters
- Syntax:
ModPagespeedDisableFilters filter[,filter...](Apache) ·pagespeed DisableFilters filter[,filter...];(nginx) - Default: —
- Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Comma-separated list of disabled filters
See Filter selection.
Disallow
- Syntax:
ModPagespeedDisallow wildcard(Apache) ·pagespeed Disallow wildcard;(nginx) - Default: —
- Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Excludes resources (and pages) whose URL matches the wildcard from optimization.
The thin nginx module’s pagespeed_disallow is the equivalent for the Docker and
reverse-proxy shape; see
Worker and reverse-proxy configuration.
EnableAggressiveRewritersForMobile
- Syntax:
ModPagespeedEnableAggressiveRewritersForMobile on|off(Apache) ·pagespeed EnableAggressiveRewritersForMobile on|off;(nginx) - Default:
on - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Allows defer_javascript and defer_iframe for mobile browsers
EnableFilters
- Syntax:
ModPagespeedEnableFilters filter[,filter...](Apache) ·pagespeed EnableFilters filter[,filter...];(nginx) - Default: —
- Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Comma-separated list of enabled filters
The filter names are on the filters reference. See
Filter selection for scoping and
interaction with RewriteLevel.
EnableRewriting
- Syntax:
pagespeed EnableRewriting on|off|unplugged|standby;(nginx) - Default:
on - Context: nginx: http, server, location
- Platform: nginx only
The module source carries no help text for this option.
ForbidAllDisabledFilters
- Syntax:
ModPagespeedForbidAllDisabledFilters on|off(Apache) ·pagespeed ForbidAllDisabledFilters on|off;(nginx) - Default:
off - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Prevents the use of disabled filters
See Filter selection.
ForbidFilters
- Syntax:
ModPagespeedForbidFilters filter[,filter...](Apache) ·pagespeed ForbidFilters filter[,filter...];(nginx) - Default: —
- Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Comma-separated list of forbidden filters
A forbidden filter cannot be re-enabled by a more specific scope or by a query parameter. See Filter selection.
pagespeed / ModPagespeed
- Syntax:
ModPagespeed on|off|unplugged|standby(Apache) ·pagespeed on|off|unplugged|standby;(nginx) - Default: —
- Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
The module switch. on optimizes; standby serves already-optimized .pagespeed. resources and answers query-parameter requests but optimizes no new traffic; unplugged intercepts nothing (on nginx, off is an alias for unplugged). unplugged can only be set at the top level or in a virtual host. nginx needs an explicit pagespeed on; in the server block.
RewriteDeadlinePerFlushMs
- Syntax:
ModPagespeedRewriteDeadlinePerFlushMs number(Apache) ·pagespeed RewriteDeadlinePerFlushMs number;(nginx) - Default:
10 - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Time to wait for resource optimization (per flush window) beforefalling back to the original resource for the request.
RewriteLevel
- Syntax:
ModPagespeedRewriteLevel CoreFilters|PassThrough|OptimizeForBandwidth|MobilizeFilters|TestingCoreFilters|AllFilters(Apache) ·pagespeed RewriteLevel CoreFilters|PassThrough|OptimizeForBandwidth|MobilizeFilters|TestingCoreFilters|AllFilters;(nginx) - Default:
PassThrough - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Base level of rewriting (PassThrough, CoreFilters)
The baseline filter set. CoreFilters is the production default most sites
start from; PassThrough runs only the filters you enable by name;
OptimizeForBandwidth optimizes resources in place without rewriting URLs;
AllFilters switches on every filter outside the dangerous set, including the
opt-in AVIF filters. MobilizeFilters and TestingCoreFilters exist for the
project’s own testing. See Filter selection.
RewriteRandomDropPercentage
- Syntax:
ModPagespeedRewriteRandomDropPercentage number(Apache) ·pagespeed RewriteRandomDropPercentage number;(nginx) - Default:
0 - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
The percentage of time that pagespeed should randomly drop an opportunity to optimize an image. The value should be an integer between 0 and 100 inclusive.
RewriteUncacheableResources
- Syntax:
ModPagespeedRewriteUncacheableResources on|off(Apache) ·pagespeed RewriteUncacheableResources on|off;(nginx) - Default:
off - Context: Apache: server config, virtual host · nginx: http, server
Allow optimization of uncacheable resources in the in-place rewriting mode.
Request handling and policy
AcceptInvalidSignatures, AccessControlAllowOrigins, AddOptionsToUrls, AddResourceHeader, AgentOptimize, AllowLoggingUrlsInLogRecord, AllowOptionsToBeSetByCookies, CombineAcrossPaths, DisableBackgroundFetchesForBots, DisableRewriteOnNoTransform, ExperimentalProxyAllRequests, ForceBuffering, HideRefererUsingMeta, HonorCsp, InlineResourcesWithoutExplicitAuthorization, ModifyCachingHeaders, ObliviousPagespeedUrls, OptionCookiesDurationMs, PreserveSubresourceHints, ProxyAuth, RejectBlacklisted, RejectBlacklistedStatusCode, RequestOptionOverride, RespectVary, RespectXForwardedProto, ServeStaleIfFetchError, ServeStaleWhileRevalidateThresholdSec, ServeXhrAccessControlHeaders, StickyQueryParameters, SupportNoScriptEnabled, TrackOriginalContentLength, UrlSigningKey, XHeaderValue
AcceptInvalidSignatures
- Syntax:
ModPagespeedAcceptInvalidSignatures on|off(Apache) ·pagespeed AcceptInvalidSignatures on|off;(nginx) - Default:
off - Context: Apache: server config, virtual host · nginx: http, server
Accept resources with invalid signatures.
AccessControlAllowOrigins
- Syntax:
ModPagespeedAccessControlAllowOrigins value(Apache) ·pagespeed AccessControlAllowOrigins value;(nginx) - Default:
(empty) - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Comma separated list of origins that are allowed to make cross-origin requests
AddOptionsToUrls
- Syntax:
ModPagespeedAddOptionsToUrls on|off(Apache) ·pagespeed AddOptionsToUrls on|off;(nginx) - Default:
off - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Add query-params with configuration adjustments to rewritten URLs.
AddResourceHeader
- Syntax:
ModPagespeedAddResourceHeader name value(Apache) ·pagespeed AddResourceHeader name value;(nginx) - Default: —
- Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Adds a custom HTTP header to every optimized resource the module serves. Repeatable, up to 20 headers.
Repeatable: specify it once per header, up to 20. Since v1.15.0+r18 the limit is enforced exactly.
ModPagespeedAddResourceHeader "X-Custom" "value"
pagespeed AddResourceHeader "X-Custom" "value";
AgentOptimize
- Syntax:
ModPagespeedAgentOptimize on|off(Apache) ·pagespeed AgentOptimize on|off;(nginx) - Default:
off - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Recognize Accept: text/markdown agent requests and add Vary: Accept on HTML. This flag is the only gate: no license or entitlement check sits behind it. 1.1 always serves optimized HTML (no markdown render).
AllowLoggingUrlsInLogRecord
- Syntax:
pagespeed AllowLoggingUrlsInLogRecord on|off;(nginx) - Default:
off - Context: nginx: http, server, location
- Platform: nginx only
The module source carries no help text for this option.
AllowOptionsToBeSetByCookies
- Syntax:
ModPagespeedAllowOptionsToBeSetByCookies on|off(Apache) ·pagespeed AllowOptionsToBeSetByCookies on|off;(nginx) - Default:
on - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Allow options to be set by cookies in addition to query parameters and request headers.
CombineAcrossPaths
- Syntax:
ModPagespeedCombineAcrossPaths on|off(Apache) ·pagespeed CombineAcrossPaths on|off;(nginx) - Default:
on - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Allow combining resources from different paths
DisableBackgroundFetchesForBots
- Syntax:
ModPagespeedDisableBackgroundFetchesForBots on|off(Apache) ·pagespeed DisableBackgroundFetchesForBots on|off;(nginx) - Default:
off - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Disable pre-emptive background fetches on bot requests.
DisableRewriteOnNoTransform
- Syntax:
ModPagespeedDisableRewriteOnNoTransform on|off(Apache) ·pagespeed DisableRewriteOnNoTransform on|off;(nginx) - Default:
on - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
If false, resource is rewritten even if no-transform header is set
When enabled, resources served with Cache-Control: no-transform are left
alone.
ExperimentalProxyAllRequests
- Syntax:
ModPagespeedExperimentalProxyAllRequests on|off(Apache) - Default:
off - Context: Apache: server config, virtual host
- Platform: Apache only
Experimental mode where mod_pagespeed acts entirely as a proxy, and doesn’t attempt to work with any local serving.
ForceBuffering
- Syntax:
ModPagespeedForceBuffering on|off(Apache) - Default:
off - Context: Apache: server config, virtual host
- Platform: Apache only
Force buffering of non-html fetch responses rather than streaming
HideRefererUsingMeta
- Syntax:
ModPagespeedHideRefererUsingMeta on|off(Apache) ·pagespeed HideRefererUsingMeta on|off;(nginx) - Default:
off - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Hides the referer by adding meta tag to the HTML
HonorCsp
- Syntax:
ModPagespeedHonorCsp on|off(Apache) ·pagespeed HonorCsp on|off;(nginx) - Default:
on - Context: Apache: server config, virtual host · nginx: http, server
Controls whether PageSpeed should pay attention to Content-Security-Policy directives
Enabled by default. The module reads Content-Security-Policy response headers
and meta tags and suppresses optimizations the policy would block, such as
inlining resources or injecting scripts. Set it to off to optimize without
consulting CSP, and verify pages that rely on strict policies. Since
v1.15.0+r18 the filters that inject inline scripts also back off cleanly when
the policy disallows inline script.
InlineResourcesWithoutExplicitAuthorization
- Syntax:
ModPagespeedInlineResourcesWithoutExplicitAuthorization value(Apache) ·pagespeed InlineResourcesWithoutExplicitAuthorization value;(nginx) - Default:
(empty) - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Specifies the resource types that can be inlined into HTML even if they do not belong to explicitly authorized domains.
ModifyCachingHeaders
- Syntax:
ModPagespeedModifyCachingHeaders on|off(Apache) ·pagespeed ModifyCachingHeaders on|off;(nginx) - Default:
on - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Set to false to disallow mod_pagespeed from editing HTML Cache-Control headers. This is not safe in general and can cause the incorrect versions of HTML to be served to users.
Controls whether the module sets caching headers on HTML responses. Do not disable it unless you fully understand the interaction with downstream caches: disabling it can cause stale optimized content to be served.
ObliviousPagespeedUrls
- Syntax:
pagespeed ObliviousPagespeedUrls on|off;(nginx) - Default:
off - Context: nginx: http, server, location
- Platform: nginx only
The module source carries no help text for this option.
OptionCookiesDurationMs
- Syntax:
ModPagespeedOptionCookiesDurationMs number(Apache) ·pagespeed OptionCookiesDurationMs number;(nginx) - Default:
600000 - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
The max-age in ms of cookies that set PageSpeed options.
PreserveSubresourceHints
- Syntax:
ModPagespeedPreserveSubresourceHints on|off(Apache) ·pagespeed PreserveSubresourceHints on|off;(nginx) - Default:
off - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location · also per request (query parameter)
Keep original subresource hints in place.
ProxyAuth
- Syntax:
ModPagespeedProxyAuth value(Apache) - Default:
(empty) - Context: Apache: server config, virtual host
- Platform: Apache only
CookieName[=Value][
] — checks proxy requests for CookieName. If CookieValue is specified, checks for that. If Redirect is specified, a failure results in a redirection to that URL otherwise a 403 is generated.RejectBlacklisted
- Syntax:
pagespeed RejectBlacklisted on|off;(nginx) - Default:
off - Context: nginx: http, server, location
- Platform: nginx only
The module source carries no help text for this option.
RejectBlacklistedStatusCode
- Syntax:
pagespeed RejectBlacklistedStatusCode number;(nginx) - Default:
403 - Context: nginx: http, server, location
- Platform: nginx only
The module source carries no help text for this option.
RequestOptionOverride
- Syntax:
ModPagespeedRequestOptionOverride value(Apache) ·pagespeed RequestOptionOverride value;(nginx) - Default:
(empty) - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Token passed in URL to enable pagespeed options in params.
RespectVary
- Syntax:
ModPagespeedRespectVary on|off(Apache) ·pagespeed RespectVary on|off;(nginx) - Default:
off - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Whether to respect Vary headers for resources. Vary is always respected for HTML.
When enabled, resources whose Vary header indicates per-request variation are
not rewritten.
RespectXForwardedProto
- Syntax:
ModPagespeedRespectXForwardedProto on|off(Apache) ·pagespeed RespectXForwardedProto on|off;(nginx) - Default:
off - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Whether to respect the X-Forwarded-Proto header.
ServeStaleIfFetchError
- Syntax:
pagespeed ServeStaleIfFetchError on|off;(nginx) - Default:
on - Context: nginx: http, server, location
- Platform: nginx only
The module source carries no help text for this option.
ServeStaleWhileRevalidateThresholdSec
- Syntax:
ModPagespeedServeStaleWhileRevalidateThresholdSec number(Apache) ·pagespeed ServeStaleWhileRevalidateThresholdSec number;(nginx) - Default:
0 - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Threshold for serving serving stale responses while revalidating in background. 0 means don’t serve stale content.Note: Stale response will be served only for non-html requests.
ServeXhrAccessControlHeaders
- Syntax:
ModPagespeedServeXhrAccessControlHeaders on|off(Apache) ·pagespeed ServeXhrAccessControlHeaders on|off;(nginx) - Default:
off - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Serve access control headers with response headers
StickyQueryParameters
- Syntax:
ModPagespeedStickyQueryParameters value(Apache) ·pagespeed StickyQueryParameters value;(nginx) - Default:
(empty) - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
The token that must be set by the PageSpeedStickyQueryParameters query parameter/header in a request to enable the setting of cookies for all other PageSpeed query parameters/headers in the request. Blank means it is disabled.
SupportNoScriptEnabled
- Syntax:
ModPagespeedSupportNoScriptEnabled on|off(Apache) ·pagespeed SupportNoScriptEnabled on|off;(nginx) - Default:
on - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Support for clients with no script support, in filters that insert new javascript.
TrackOriginalContentLength
- Syntax:
ModPagespeedTrackOriginalContentLength on|off(Apache) ·pagespeed TrackOriginalContentLength on|off;(nginx) - Default: —
- Context: Apache: server config · nginx: http
Add X-Original-Content-Length headers to rewritten resources
UrlSigningKey
- Syntax:
ModPagespeedUrlSigningKey value(Apache) ·pagespeed UrlSigningKey value;(nginx) - Default:
(empty) - Context: Apache: server config, virtual host · nginx: http, server
Key used for signing .pagespeed resource URLs.
XHeaderValue
- Syntax:
ModPagespeedXHeaderValue value(Apache) ·pagespeed XHeaderValue value;(nginx) - Default:
(empty) - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Set the value for the X-Mod-Pagespeed HTTP header
Sets the value of the X-Mod-Pagespeed (Apache) or X-Page-Speed (nginx, IIS)
response header. The default is the module
version string.
In-place resource optimization
CacheSmallImagesUnrewritten, InPlacePreemptiveRewriteCss, InPlacePreemptiveRewriteCssImages, InPlacePreemptiveRewriteImages, InPlacePreemptiveRewriteJavascript, InPlaceResourceOptimization, InPlaceRewriteDeadlineMs, InPlaceSMaxAgeSec, InPlaceWaitForOptimized, IproMaxConcurrentRecordings, IproMaxResponseBytes, NoTransformOptimizedImages, ProactivelyFreshenUserFacingRequest, ProactiveResourceFreshening
CacheSmallImagesUnrewritten
- Syntax:
pagespeed CacheSmallImagesUnrewritten on|off;(nginx) - Default:
off - Context: nginx: http, server, location
- Platform: nginx only
The module source carries no help text for this option.
InPlacePreemptiveRewriteCss
- Syntax:
ModPagespeedInPlacePreemptiveRewriteCss on|off(Apache) ·pagespeed InPlacePreemptiveRewriteCss on|off;(nginx) - Default:
on - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
If set, issue preemptive rewrites of CSS on the HTML path when configured to use IPRO.
InPlacePreemptiveRewriteCssImages
- Syntax:
ModPagespeedInPlacePreemptiveRewriteCssImages on|off(Apache) ·pagespeed InPlacePreemptiveRewriteCssImages on|off;(nginx) - Default:
on - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
If set, issue preemptive rewrites of CSS images on the IPRO serving path.
InPlacePreemptiveRewriteImages
- Syntax:
ModPagespeedInPlacePreemptiveRewriteImages on|off(Apache) ·pagespeed InPlacePreemptiveRewriteImages on|off;(nginx) - Default:
on - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
If set, issue preemptive rewrites of images on the HTML path when configured to use IPRO.
InPlacePreemptiveRewriteJavascript
- Syntax:
ModPagespeedInPlacePreemptiveRewriteJavascript on|off(Apache) ·pagespeed InPlacePreemptiveRewriteJavascript on|off;(nginx) - Default:
on - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
If set, issue preemptive rewrites of JS on the HTML path when configured to use IPRO.
InPlaceResourceOptimization
- Syntax:
ModPagespeedInPlaceResourceOptimization on|off(Apache) ·pagespeed InPlaceResourceOptimization on|off;(nginx) - Default:
on - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Allow rewriting resources even when they are fetched over non-pagespeed URLs.
InPlaceRewriteDeadlineMs
- Syntax:
ModPagespeedInPlaceRewriteDeadlineMs number(Apache) ·pagespeed InPlaceRewriteDeadlineMs number;(nginx) - Default:
10 - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Time to wait for an in-place resource optimization beforefalling back to the original resource for the request.
InPlaceSMaxAgeSec
- Syntax:
ModPagespeedInPlaceSMaxAgeSec number(Apache) ·pagespeed InPlaceSMaxAgeSec number;(nginx) - Default:
10 - Context: Apache: server config, virtual host · nginx: http, server
What to set s-maxage to on not-yet-optimized ipro resources
InPlaceWaitForOptimized
- Syntax:
ModPagespeedInPlaceWaitForOptimized on|off(Apache) ·pagespeed InPlaceWaitForOptimized on|off;(nginx) - Default:
off - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Wait for optimizations to complete
IproMaxConcurrentRecordings
- Syntax:
ModPagespeedIproMaxConcurrentRecordings number(Apache) ·pagespeed IproMaxConcurrentRecordings number;(nginx) - Default:
10 - Context: Apache: server config, virtual host (tolerated) · nginx: http
Limit allowed number of IPRO recordings
IproMaxResponseBytes
- Syntax:
ModPagespeedIproMaxResponseBytes number(Apache) ·pagespeed IproMaxResponseBytes number;(nginx) - Default:
10485760 - Context: Apache: server config, virtual host (tolerated) · nginx: http
Limit allowed size of IPRO responses. Set to 0 for unlimited.
NoTransformOptimizedImages
- Syntax:
ModPagespeedNoTransformOptimizedImages on|off(Apache) ·pagespeed NoTransformOptimizedImages on|off;(nginx) - Default:
off - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Add no-transform header to cache-control for optimized images
ProactivelyFreshenUserFacingRequest
- Syntax:
pagespeed ProactivelyFreshenUserFacingRequest on|off;(nginx) - Default:
off - Context: nginx: http, server, location
- Platform: nginx only
The module source carries no help text for this option.
ProactiveResourceFreshening
- Syntax:
ModPagespeedProactiveResourceFreshening on|off(Apache) ·pagespeed ProactiveResourceFreshening on|off;(nginx) - Default:
off - Context: Apache: server config, virtual host · nginx: http, server
If true, allows proactive freshening of inputs to the resource when they are close to expiry.
Domains and URLs
ClientDomainRewrite, CssPreserveURLs, Domain, DomainRewriteCookies, DomainRewriteHyperlinks, DomainShardCount, ImagePreserveURLs, JsPreserveURLs, LoadFromFile, LoadFromFileCacheTtlMs, LoadFromFileMatch, LoadFromFileRule, LoadFromFileRuleMatch, MapOriginDomain, MapProxyDomain, MapRewriteDomain, MaxSegmentLength, MaxUrlSize, PreserveUrlRelativity, ProxySuffix, RemoteConfigurationTimeoutMs, RemoteConfigurationUrl, ShardDomain, StaticAssetCDN, StaticAssetPrefix, UrlValuedAttribute
ClientDomainRewrite
- Syntax:
ModPagespeedClientDomainRewrite on|off(Apache) ·pagespeed ClientDomainRewrite on|off;(nginx) - Default:
off - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Allow rewrite_domains to rewrite urls on the client side.
CssPreserveURLs
- Syntax:
ModPagespeedCssPreserveURLs on|off(Apache) ·pagespeed CssPreserveURLs on|off;(nginx) - Default:
off - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Disable the rewriting of CSS URLs.
Domain
- Syntax:
ModPagespeedDomain domain(Apache) ·pagespeed Domain domain;(nginx) - Default: —
- Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Authorizes the module to fetch and rewrite resources on this domain.
DomainRewriteCookies
- Syntax:
ModPagespeedDomainRewriteCookies on|off(Apache) ·pagespeed DomainRewriteCookies on|off;(nginx) - Default:
off - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Allow rewrite_domains to rewrite domains in Set-Cookie headers.
DomainRewriteHyperlinks
- Syntax:
ModPagespeedDomainRewriteHyperlinks on|off(Apache) ·pagespeed DomainRewriteHyperlinks on|off;(nginx) - Default:
off - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Allow rewrite_domains to rewrite <form> and <a> tags in addition to resource tags.
DomainShardCount
- Syntax:
pagespeed DomainShardCount number;(nginx) - Default:
0 - Context: nginx: http, server, location · also per request (query parameter)
- Platform: nginx only
The module source carries no help text for this option.
ImagePreserveURLs
- Syntax:
ModPagespeedImagePreserveURLs on|off(Apache) ·pagespeed ImagePreserveURLs on|off;(nginx) - Default:
off - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Disable the rewriting of Image URLs.
JsPreserveURLs
- Syntax:
ModPagespeedJsPreserveURLs on|off(Apache) ·pagespeed JsPreserveURLs on|off;(nginx) - Default:
off - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Disable the rewriting of Javascript URLs.
LoadFromFile
- Syntax:
ModPagespeedLoadFromFile url_prefix filename_prefix(Apache) ·pagespeed LoadFromFile url_prefix filename_prefix;(nginx) - Default: —
- Context: Apache: server config, virtual host · nginx: http, server
Serves resources under a URL prefix straight from the filesystem instead of fetching them over HTTP.
LoadFromFileCacheTtlMs
- Syntax:
ModPagespeedLoadFromFileCacheTtlMs number(Apache) ·pagespeed LoadFromFileCacheTtlMs number;(nginx) - Default:
300000 - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Time in milliseconds to cache resources loaded from file that lack an Expires or Cache-Control header. If not explicitly set, defaults to using the value set by implicit_cache_ttl_ms
LoadFromFileMatch
- Syntax:
ModPagespeedLoadFromFileMatch url_regexp filename_prefix(Apache) ·pagespeed LoadFromFileMatch url_regexp filename_prefix;(nginx) - Default: —
- Context: Apache: server config, virtual host · nginx: http, server
LoadFromFile with a regular expression on the URL and a replacement filename prefix.
LoadFromFileRule
- Syntax:
ModPagespeedLoadFromFileRule Allow|Disallow filename_prefix(Apache) ·pagespeed LoadFromFileRule Allow|Disallow filename_prefix;(nginx) - Default: —
- Context: Apache: server config, virtual host · nginx: http, server
Allows or disallows loading from file for a filename prefix after a LoadFromFile mapping.
LoadFromFileRuleMatch
- Syntax:
ModPagespeedLoadFromFileRuleMatch Allow|Disallow filename_regexp(Apache) ·pagespeed LoadFromFileRuleMatch Allow|Disallow filename_regexp;(nginx) - Default: —
- Context: Apache: server config, virtual host · nginx: http, server
LoadFromFileRule with a regular expression on the filename.
MapOriginDomain
- Syntax:
ModPagespeedMapOriginDomain to_domain from_domain[,from_domain...] [host_header](Apache) ·pagespeed MapOriginDomain to_domain from_domain[,from_domain...] [host_header];(nginx) - Default: —
- Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Fetches resources for the public domain(s) from the origin domain instead, optionally sending a different Host header.
MapProxyDomain
- Syntax:
ModPagespeedMapProxyDomain proxy_domain origin_domain [to_domain](Apache) ·pagespeed MapProxyDomain proxy_domain origin_domain [to_domain];(nginx) - Default: —
- Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Proxies and optimizes resources from a separate origin domain under a path of this site.
MapRewriteDomain
- Syntax:
ModPagespeedMapRewriteDomain to_domain from_domain[,from_domain...](Apache) ·pagespeed MapRewriteDomain to_domain from_domain[,from_domain...];(nginx) - Default: —
- Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Rewrites optimized resource URLs from the listed domains onto another domain (for example a CDN hostname).
MaxSegmentLength
- Syntax:
ModPagespeedMaxSegmentLength number(Apache) ·pagespeed MaxSegmentLength number;(nginx) - Default:
1024 - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Maximum size of a URL segment.
Why and when to lower it is in URL segment length limits.
MaxUrlSize
- Syntax:
pagespeed MaxUrlSize number;(nginx) - Default:
2083 - Context: nginx: http, server, location
- Platform: nginx only
The module source carries no help text for this option.
PreserveUrlRelativity
- Syntax:
ModPagespeedPreserveUrlRelativity on|off(Apache) ·pagespeed PreserveUrlRelativity on|off;(nginx) - Default:
on - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Keep rewritten URLs as relative as the original resource URL was.
When enabled, relative URLs in rewritten HTML stay relative instead of being converted to absolute URLs.
ProxySuffix
- Syntax:
ModPagespeedProxySuffix suffix(Apache) ·pagespeed ProxySuffix suffix;(nginx) - Default: —
- Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Sets up a proxy suffix to be used when slurping.
RemoteConfigurationTimeoutMs
- Syntax:
ModPagespeedRemoteConfigurationTimeoutMs number(Apache) ·pagespeed RemoteConfigurationTimeoutMs number;(nginx) - Default:
1000 - Context: Apache: server config, virtual host · nginx: http, server
Timeout for fetch of remote configuration file.
RemoteConfigurationUrl
- Syntax:
ModPagespeedRemoteConfigurationUrl value(Apache) ·pagespeed RemoteConfigurationUrl value;(nginx) - Default:
(empty) - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
URL of site from which to pull remote configuration files
ShardDomain
- Syntax:
ModPagespeedShardDomain from_domain shard_domain[,shard_domain...](Apache) ·pagespeed ShardDomain from_domain shard_domain[,shard_domain...];(nginx) - Default: —
- Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Spreads optimized resource URLs for a domain across the listed shard domains.
StaticAssetCDN
- Syntax:
ModPagespeedStaticAssetCDN value(Apache) ·pagespeed StaticAssetCDN value;(nginx) - Default:
(empty) - Context: Apache: server config · nginx: http
Configures serving of helper scripts from external URLs rather than from compiled-in versions via static handler.
StaticAssetPrefix
- Syntax:
ModPagespeedStaticAssetPrefix url_prefix(Apache) ·pagespeed StaticAssetPrefix url_prefix;(nginx) - Default: —
- Context: Apache: server config · nginx: http
Where to serve static support files for pagespeed filters from.
URL prefix the module serves its own static assets from (the JavaScript
libraries and images some filters inject). The default is /pagespeed_static/.
UrlValuedAttribute
- Syntax:
ModPagespeedUrlValuedAttribute element attribute category(Apache) ·pagespeed UrlValuedAttribute element attribute category;(nginx) - Default: —
- Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Declares an extra element attribute that holds a URL, with the resource category (image, script, stylesheet, otherResource, hyperlink) it should be treated as.
Optimizer worker
DaemonApiSocketPath, DaemonServeStoredEncodings, DaemonSocketPath, DaemonVolumePath
DaemonApiSocketPath
- Syntax:
ModPagespeedDaemonApiSocketPath value(Apache) ·pagespeed DaemonApiSocketPath value;(nginx) - Default:
/run/pagespeed-optimizer/api.sock - Context: Apache: server config, virtual host · nginx: http, server
Path of the optimizer worker’s management API unix socket, backing the /v1/daemon/* admin endpoints. Empty disables them. This is a different socket from DaemonSocketPath (the notification socket).
On nginx: Set the unix socket path of the optimizer worker’s management API, backing the /v1/daemon/* admin endpoints. Empty disables them.
DaemonServeStoredEncodings
- Syntax:
ModPagespeedDaemonServeStoredEncodings on|off(Apache) ·pagespeed DaemonServeStoredEncodings on|off;(nginx) - Default:
off - Context: Apache: server config, virtual host · nginx: http, server
Serve the optimizer worker’s stored gzip and brotli copies of stylesheets, scripts and SVG images to clients that accept them, labelled with Content-Encoding, instead of compressing the uncompressed copy on the way out. Default off.
DaemonSocketPath
- Syntax:
ModPagespeedDaemonSocketPath value(Apache) ·pagespeed DaemonSocketPath value;(nginx) - Default:
(empty) - Context: Apache: server config, virtual host · nginx: http, server
Path of the optimizer worker’s notification socket. Set this together with DaemonVolumePath to hand in-place optimization to the worker; leave both unset to keep the classic in-place path.
On nginx: Path of the optimizer worker’s notification socket. Set this together with DaemonVolumePath; leave both unset to keep the classic in-place path. With both set, the nginx port records through the worker and serves the optimized copies from its shared cache.
Set together with DaemonVolumePath to hand in-place optimization to the
optimizer worker installed beside the module. The worker’s own flags are on
Worker and reverse-proxy configuration.
DaemonVolumePath
- Syntax:
ModPagespeedDaemonVolumePath value(Apache) ·pagespeed DaemonVolumePath value;(nginx) - Default:
(empty) - Context: Apache: server config, virtual host · nginx: http, server
Path of the optimizer worker’s shared cache volume. Keep this on a DIFFERENT path from FileCachePath. Set this together with DaemonSocketPath; leave both unset to keep the classic in-place path.
On nginx: Path of the optimizer worker’s shared cache volume. Keep this on a DIFFERENT path from FileCachePath. Set this together with DaemonSocketPath; leave both unset to keep the classic in-place path. With both set, the nginx port records through the worker and serves the optimized copies from its shared cache.
Keep this on a different path from FileCachePath. The worker creates the
volume under its --cache-dir; see
Worker and reverse-proxy configuration.
Bot authentication and licensing
RslCapDirectoryHost, RslCapEnforcement, RslCapIssuer, RslCapKeyDirectoryAllowlist, RslCapKeyDirectoryFile, RslCapKeyDirectoryRefreshSec, RslCapKeyDirectoryUrl, RslCapRequestedLicense, RslCapRequestedScope, WebBotAuth, WebBotAuthBotDetection, WebBotAuthDirectoryHost, WebBotAuthKeyDirectoryAllowlist, WebBotAuthKeyDirectoryFile, WebBotAuthKeyDirectoryRefreshSec, WebBotAuthKeyDirectoryUrl, WebBotAuthPublicCounter, WebBotAuthTelemetry, WebBotAuthVerifiedBots
RslCapDirectoryHost
- Syntax:
pagespeed RslCapDirectoryHost value;(nginx) - Default:
(empty) - Context: nginx: http, server
- Platform: nginx only
Operator-mapped issuer directory host passed to the key provider (plane-split, never request-derived). Ignored by the v1 static-file provider; used by the follow-up network provider. Default empty.
RslCapEnforcement
- Syntax:
pagespeed RslCapEnforcement on|off;(nginx) - Default:
off - Context: nginx: http, server
- Platform: nginx only
Enable RSL-CAP capability-token enforcement: an Authorization: License token is validated and the verdict is mapped to an inline 401/402. Never settles/meters. Default off.
See RSL-CAP enforcement.
RslCapIssuer
- Syntax:
pagespeed RslCapIssuer value;(nginx) - Default:
(empty) - Context: nginx: http, server
- Platform: nginx only
Optional issuer pin: when set, an otherwise-authorized token whose iss != this value is rejected (401). Use when a directory host may serve multiple issuers. Default empty.
RslCapKeyDirectoryAllowlist
- Syntax:
pagespeed RslCapKeyDirectoryAllowlist value;(nginx) - Default:
(empty) - Context: nginx: http, server
- Platform: nginx only
SSRF allowlist: comma-separated https origins the RSL-CAP warm-fetch may contact. Empty => warm-fetch disabled (fail-closed). Default empty.
RslCapKeyDirectoryFile
- Syntax:
pagespeed RslCapKeyDirectoryFile value;(nginx) - Default:
(empty) - Context: nginx: http, server
- Platform: nginx only
Path to a local JWKS file (the issuer’s published key directory, copied locally by the operator) used to resolve RSL-CAP signing keys. v1: synchronous, no network fetch. Default empty.
RslCapKeyDirectoryRefreshSec
- Syntax:
pagespeed RslCapKeyDirectoryRefreshSec value;(nginx) - Default:
(empty) - Context: nginx: http, server
- Platform: nginx only
RSL-CAP warm-fetch refresh interval in seconds (clamped). Empty => default 3600. Default empty.
RslCapKeyDirectoryUrl
- Syntax:
pagespeed RslCapKeyDirectoryUrl value;(nginx) - Default:
(empty) - Context: nginx: http, server
- Platform: nginx only
HTTPS URL of the issuer’s JWKS directory, fetched off-request by a background thread and cached; the request path reads cache-only. Requires RslCapKeyDirectoryAllowlist and RslCapDirectoryHost. Default empty (no network fetch).
RslCapRequestedLicense
- Syntax:
pagespeed RslCapRequestedLicense value;(nginx) - Default:
(empty) - Context: nginx: http, server
- Platform: nginx only
License id this route requires; a token must grant it (and the requested scope) to be authorized, else 402. Default empty.
RslCapRequestedScope
- Syntax:
pagespeed RslCapRequestedScope value;(nginx) - Default:
(empty) - Context: nginx: http, server
- Platform: nginx only
Scope this route requires; a token must grant it (and the requested license) to be authorized, else 402. Default empty.
WebBotAuth
- Syntax:
pagespeed WebBotAuth on|off;(nginx) - Default:
off - Context: nginx: http, server
- Platform: nginx only
Enable observe-only Web-Bot-Auth (RFC 9421) request classification, surfaced as $x_verified_bot. Never blocks. Default off.
WebBotAuthBotDetection
- Syntax:
pagespeed WebBotAuthBotDetection on|off;(nginx) - Default:
off - Context: nginx: http, server
- Platform: nginx only
Let a verified Web-Bot-Auth signature classify the request as an automated client for PageSpeed’s own bot detection, so a signed agent is recognised even when it presents a browser user-agent. Suppresses the measurement beacons and lazyload for that request; never blocks it. Requires WebBotAuth. Default off (verdict stays observe-only).
Opt-in: a cryptographically verified Web Bot Auth signature (RFC 9421)
classifies the request as automated for the module’s own bot detection, so a
signed agent is recognized even when it presents a browser user agent. Requires
WebBotAuth. See Web Bot Auth.
WebBotAuthDirectoryHost
- Syntax:
pagespeed WebBotAuthDirectoryHost value;(nginx) - Default:
(empty) - Context: nginx: http, server
- Platform: nginx only
The signer directory’s host identity: the warm-fetch cache key, paired with WebBotAuthKeyDirectoryUrl. Ignored by the local-file static provider. Never request-derived. Default empty.
WebBotAuthKeyDirectoryAllowlist
- Syntax:
pagespeed WebBotAuthKeyDirectoryAllowlist value;(nginx) - Default:
(empty) - Context: nginx: http, server
- Platform: nginx only
SSRF allowlist: comma-separated https origins (scheme://host[
]) the warm-fetch may contact. Empty => warm-fetch disabled (fail-closed). Default empty.WebBotAuthKeyDirectoryFile
- Syntax:
pagespeed WebBotAuthKeyDirectoryFile value;(nginx) - Default:
(empty) - Context: nginx: http, server
- Platform: nginx only
Path to a local JWKS file (the signer’s published key directory, copied locally by the operator) used to verify signatures. A1 v1: no network fetch. Default empty.
WebBotAuthKeyDirectoryRefreshSec
- Syntax:
pagespeed WebBotAuthKeyDirectoryRefreshSec value;(nginx) - Default:
(empty) - Context: nginx: http, server
- Platform: nginx only
Warm-fetch refresh interval in seconds (clamped). Empty => default 3600. Default empty.
WebBotAuthKeyDirectoryUrl
- Syntax:
pagespeed WebBotAuthKeyDirectoryUrl value;(nginx) - Default:
(empty) - Context: nginx: http, server
- Platform: nginx only
HTTPS URL of the signer’s JWKS directory, fetched off-request by a background thread and cached; the request path reads cache-only and never fetches. Requires WebBotAuthKeyDirectoryAllowlist and WebBotAuthDirectoryHost. Default empty (no network fetch).
WebBotAuthPublicCounter
- Syntax:
pagespeed WebBotAuthPublicCounter value;(nginx) - Default:
(empty) - Context: nginx: http, server
- Platform: nginx only
Opt-in verified-crawl counter mode (experimental): off (default) | private | public. Enabling a non-off mode publishes a discoverable marker at /.well-known/webbotauth-counter; the exact document is gated by the PAGESPEED_WEB_BOT_AUTH_COUNTER_TOKEN env bearer token. Default off (endpoint invisible).
WebBotAuthTelemetry
- Syntax:
pagespeed WebBotAuthTelemetry on|off;(nginx) - Default:
off - Context: nginx: http, server
- Platform: nginx only
Count verified/signed-agent requests in the opt-in web_bot_auth_verified_signed_requests statistic (and non-web-bot-auth signature material in web_bot_auth_other_signature_requests). Default off.
WebBotAuthVerifiedBots
- Syntax:
pagespeed WebBotAuthVerifiedBots value;(nginx) - Default:
(empty) - Context: nginx: http, server
- Platform: nginx only
Verified-bot registry: comma-separated keyid=name pairs.
Statistics, console and logging
AdminDomains, AdminPath, ConsoleDomains, ConsolePath, GlobalAdminDomains, GlobalAdminPath, GlobalStatisticsDomains, GlobalStatisticsPath, InstallCrashHandler, ListOutstandingUrlsOnError, LogBackgroundRewrite, LogDir, LogMobilizationSamples, LogRewriteTiming, LogUrlIndices, MaxRewriteInfoLogSize, MessageBufferSize, MessagesDomains, MessagesPath, ReportUnloadTime, SlowFileLatencyUs, Statistics, StatisticsDomains, StatisticsLogging, StatisticsLoggingChartsCSS, StatisticsLoggingChartsJS, StatisticsLoggingIntervalMs, StatisticsLoggingMaxFileSizeKb, StatisticsPath, StrictAdminAccess, UsePerVHostStatistics
AdminDomains
- Syntax:
ModPagespeedAdminDomains Allow|Disallow domain_wildcard(Apache) ·pagespeed AdminDomains Allow|Disallow domain_wildcard;(nginx) - Default: —
- Context: Apache: server config, virtual host · nginx: http, server, location
Access control for the per-host admin pages: Allow or Disallow a domain wildcard. Default: Allow *.
AdminPath
- Syntax:
pagespeed AdminPath value;(nginx) - Default:
(empty) - Context: nginx: http, server
- Platform: nginx only
Set the admin path. Ex: /pagespeed_admin
ConsoleDomains
- Syntax:
ModPagespeedConsoleDomains Allow|Disallow domain_wildcard(Apache) ·pagespeed ConsoleDomains Allow|Disallow domain_wildcard;(nginx) - Default: —
- Context: Apache: server config, virtual host · nginx: http, server, location
Access control for the console page: Allow or Disallow a domain wildcard. Default: Allow *.
ConsolePath
- Syntax:
pagespeed ConsolePath value;(nginx) - Default:
(empty) - Context: nginx: http, server
- Platform: nginx only
Set the console path. Ex: /pagespeed_console
GlobalAdminDomains
- Syntax:
ModPagespeedGlobalAdminDomains Allow|Disallow domain_wildcard(Apache) ·pagespeed GlobalAdminDomains Allow|Disallow domain_wildcard;(nginx) - Default: —
- Context: Apache: server config, virtual host · nginx: http, server, location
Access control for the global admin pages: Allow or Disallow a domain wildcard. Default: Allow *.
GlobalAdminPath
- Syntax:
pagespeed GlobalAdminPath value;(nginx) - Default:
(empty) - Context: nginx: http
- Platform: nginx only
Set the global admin path. Ex: /pagespeed_global_admin
GlobalStatisticsDomains
- Syntax:
ModPagespeedGlobalStatisticsDomains Allow|Disallow domain_wildcard(Apache) ·pagespeed GlobalStatisticsDomains Allow|Disallow domain_wildcard;(nginx) - Default: —
- Context: Apache: server config, virtual host · nginx: http, server, location
Access control for the global statistics page: Allow or Disallow a domain wildcard. Default: Allow *.
GlobalStatisticsPath
- Syntax:
pagespeed GlobalStatisticsPath value;(nginx) - Default:
(empty) - Context: nginx: http
- Platform: nginx only
Set the global statistics path. Ex: /ngx_pagespeed_global_statistics
InstallCrashHandler
- Syntax:
ModPagespeedInstallCrashHandler on|off(Apache) ·pagespeed InstallCrashHandler on|off;(nginx) - Default: —
- Context: Apache: server config · nginx: http
Try to dump backtrace on crashes. For developer use
ListOutstandingUrlsOnError
- Syntax:
ModPagespeedListOutstandingUrlsOnError on|off(Apache) ·pagespeed ListOutstandingUrlsOnError on|off;(nginx) - Default: —
- Context: Apache: server config · nginx: http
Adds an error message into the log for every URL fetch in flight when the HTTP stack encounters a system error, e.g. Connection Refused
Enable it only while debugging fetch problems; it is noisy in production.
LogBackgroundRewrite
- Syntax:
pagespeed LogBackgroundRewrite on|off;(nginx) - Default:
off - Context: nginx: http, server
- Platform: nginx only
The module source carries no help text for this option.
LogDir
- Syntax:
ModPagespeedLogDir value(Apache) ·pagespeed LogDir value;(nginx) - Default:
(empty) - Context: Apache: server config, virtual host · nginx: http, server
Directory to store logs in.
LogMobilizationSamples
- Syntax:
ModPagespeedLogMobilizationSamples on|off(Apache) ·pagespeed LogMobilizationSamples on|off;(nginx) - Default:
off - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Verbose debugging of all sample data generated by mobilization_label_filter.
LogRewriteTiming
- Syntax:
ModPagespeedLogRewriteTiming on|off(Apache) ·pagespeed LogRewriteTiming on|off;(nginx) - Default:
off - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Whether or not to report timing information about HtmlParse.
LogUrlIndices
- Syntax:
ModPagespeedLogUrlIndices on|off(Apache) ·pagespeed LogUrlIndices on|off;(nginx) - Default:
off - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Whether or not to log URL indices for rewriter applications.
MaxRewriteInfoLogSize
- Syntax:
pagespeed MaxRewriteInfoLogSize number;(nginx) - Default:
150 - Context: nginx: http, server, location
- Platform: nginx only
The module source carries no help text for this option.
MessageBufferSize
- Syntax:
ModPagespeedMessageBufferSize bytes(Apache) ·pagespeed MessageBufferSize bytes;(nginx) - Default: —
- Context: Apache: server config · nginx: http
Size in bytes of the in-memory message history shown on the messages page; 0 disables it.
MessagesDomains
- Syntax:
ModPagespeedMessagesDomains Allow|Disallow domain_wildcard(Apache) ·pagespeed MessagesDomains Allow|Disallow domain_wildcard;(nginx) - Default: —
- Context: Apache: server config, virtual host · nginx: http, server, location
Access control for the message history page: Allow or Disallow a domain wildcard. Default: Allow *.
MessagesPath
- Syntax:
pagespeed MessagesPath value;(nginx) - Default:
(empty) - Context: nginx: http, server
- Platform: nginx only
Set the messages path. Ex: /ngx_pagespeed_message
ReportUnloadTime
- Syntax:
ModPagespeedReportUnloadTime on|off(Apache) ·pagespeed ReportUnloadTime on|off;(nginx) - Default:
off - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Deprecated, no effect: the beacon is now sent on page-hide, which covers pre-onload abandonment without breaking bfcache.
SlowFileLatencyUs
- Syntax:
ModPagespeedSlowFileLatencyUs number(Apache) ·pagespeed SlowFileLatencyUs number;(nginx) - Default:
50000 - Context: Apache: server config, virtual host · nginx: http, server
Maximum time in microseconds to allow for file operations before logging and bumping a stat
Statistics
- Syntax:
ModPagespeedStatistics on|off(Apache) ·pagespeed Statistics on|off;(nginx) - Default:
on - Context: Apache: server config, virtual host · nginx: http, server
Whether to collect cross-process statistics.
StatisticsDomains
- Syntax:
ModPagespeedStatisticsDomains Allow|Disallow domain_wildcard(Apache) ·pagespeed StatisticsDomains Allow|Disallow domain_wildcard;(nginx) - Default: —
- Context: Apache: server config, virtual host · nginx: http, server, location
Access control for the per-host statistics page: Allow or Disallow a domain wildcard. Default: Allow *.
StatisticsLogging
- Syntax:
ModPagespeedStatisticsLogging on|off(Apache) ·pagespeed StatisticsLogging on|off;(nginx) - Default:
off - Context: Apache: server config, virtual host · nginx: http, server
Whether to log statistics if they’re being collected.
StatisticsLoggingChartsCSS
- Syntax:
ModPagespeedStatisticsLoggingChartsCSS value(Apache) ·pagespeed StatisticsLoggingChartsCSS value;(nginx) - Default:
(empty) - Context: Apache: server config, virtual host · nginx: http, server
Where to find an offline copy of the Google Charts Tools API CSS.
StatisticsLoggingChartsJS
- Syntax:
ModPagespeedStatisticsLoggingChartsJS value(Apache) ·pagespeed StatisticsLoggingChartsJS value;(nginx) - Default:
(empty) - Context: Apache: server config, virtual host · nginx: http, server
Where to find an offline copy of the Google Charts Tools API JS.
StatisticsLoggingIntervalMs
- Syntax:
ModPagespeedStatisticsLoggingIntervalMs number(Apache) ·pagespeed StatisticsLoggingIntervalMs number;(nginx) - Default:
600000 - Context: Apache: server config, virtual host · nginx: http, server
How often to log statistics, in milliseconds.
StatisticsLoggingMaxFileSizeKb
- Syntax:
ModPagespeedStatisticsLoggingMaxFileSizeKb number(Apache) ·pagespeed StatisticsLoggingMaxFileSizeKb number;(nginx) - Default:
1024 - Context: Apache: server config, virtual host · nginx: http, server
Max size for statistics logging file.
StatisticsPath
- Syntax:
pagespeed StatisticsPath value;(nginx) - Default:
(empty) - Context: nginx: http, server
- Platform: nginx only
Set the statistics path. Ex: /ngx_pagespeed_statistics
StrictAdminAccess
- Syntax:
ModPagespeedStrictAdminAccess on|off(Apache) ·pagespeed StrictAdminAccess on|off;(nginx) - Default:
off - Context: Apache: server config · nginx: http
OPT-IN, default off. When on, the admin, statistics, console and message handlers deny non-loopback clients unless an explicit *Domains allowlist is configured. The loopback decision uses the validated client connection IP, not the Host header. When off (default) access checks behave exactly as before.
UsePerVHostStatistics
- Syntax:
ModPagespeedUsePerVHostStatistics on|off(Apache) ·pagespeed UsePerVHostStatistics on|off;(nginx) - Default: —
- Context: Apache: server config · nginx: http
If true, keep track of statistics per VHost and not just globally
Images
AvifAnimatedRecompressionQuality, AvifQualityForSaveData, AvifRecompressionQuality, AvifRecompressionQualityForSmallScreens, AvifTimeoutMs, CriticalImagesBeaconEnabled, CssImageInlineMaxBytes, EnableLazyLoadHighResImages, ImageInlineMaxBytes, ImageJpegNumProgressiveScans, ImageJpegNumProgressiveScansForSmallScreens, ImageLimitOptimizedPercent, ImageLimitRenderedAreaPercent, ImageLimitResizeAreaPercent, ImageMaxRewritesAtOnce, ImageProvenanceCarry, ImageRecompressionQuality, ImageResolutionLimitBytes, InlineOnlyCriticalImages, JpegQualityForSaveData, JpegRecompressionQuality, JpegRecompressionQualityForSmallScreens, LazyloadImagesAfterOnload, LazyloadImagesBlankUrl, LazyloadImagesMode, LazyloadImagesSkipFirst, MaxImageSizeLowResolutionBytes, MaxInlinedPreviewImagesIndex, MaxLowResImageSizeBytes, MaxLowResToHighResImageSizePercentage, MinImageSizeLowResolutionBytes, PreserveImageProvenance, ProgressiveJpegMinBytes, ResponsiveImageDensities, ServeRewrittenAvifUrlsToAnyAgent, ServeRewrittenWebpUrlsToAnyAgent, UseBlankImageForInlinePreview, WebpAnimatedRecompressionQuality, WebpQualityForSaveData, WebpRecompressionQuality, WebpRecompressionQualityForSmallScreens, WebpTimeoutMs
AvifAnimatedRecompressionQuality
- Syntax:
ModPagespeedAvifAnimatedRecompressionQuality number(Apache) ·pagespeed AvifAnimatedRecompressionQuality number;(nginx) - Default:
50 - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location · also per request (query parameter)
Quality for rewritten animated avif images [-1,100], 100 refers to best quality, -1 uses ImageRecompressionQuality.
AvifQualityForSaveData
- Syntax:
ModPagespeedAvifQualityForSaveData number(Apache) ·pagespeed AvifQualityForSaveData number;(nginx) - Default:
45 - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location · also per request (query parameter)
Set quality for the images which will be optimized to lossy AVIF format in the Save-Data mode. Use a value in [0,100] to explicitly set the quality. Use -1 to ignore the Save-Data header.
AvifRecompressionQuality
- Syntax:
ModPagespeedAvifRecompressionQuality number(Apache) ·pagespeed AvifRecompressionQuality number;(nginx) - Default:
60 - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location · also per request (query parameter)
Quality for rewritten avif images [-1,100], 100 refers to best quality, -1 uses ImageRecompressionQuality.
AvifRecompressionQualityForSmallScreens
- Syntax:
ModPagespeedAvifRecompressionQualityForSmallScreens number(Apache) ·pagespeed AvifRecompressionQualityForSmallScreens number;(nginx) - Default:
50 - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location · also per request (query parameter)
Quality for rewritten avif images for small screens. [-1,100], 100 refers to best quality, -1 falls back to AvifRecompressionQuality.
AvifTimeoutMs
- Syntax:
ModPagespeedAvifTimeoutMs number(Apache) ·pagespeed AvifTimeoutMs number;(nginx) - Default:
5000 - Context: Apache: server config, virtual host (tolerated) · nginx: http
Timeout for AVIF still-image encoding, in milliseconds; the encoder speed is derived from this budget.
CriticalImagesBeaconEnabled
- Syntax:
ModPagespeedCriticalImagesBeaconEnabled on|off(Apache) ·pagespeed CriticalImagesBeaconEnabled on|off;(nginx) - Default:
on - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Enable insertion of client-side critical image detection js for image optimization filters.
CssImageInlineMaxBytes
- Syntax:
ModPagespeedCssImageInlineMaxBytes number(Apache) ·pagespeed CssImageInlineMaxBytes number;(nginx) - Default:
0 - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location · also per request (query parameter)
Number of bytes below which CSS images will be inlined.
EnableLazyLoadHighResImages
- Syntax:
pagespeed EnableLazyLoadHighResImages on|off;(nginx) - Default:
off - Context: nginx: http, server, location
- Platform: nginx only
The module source carries no help text for this option.
ImageInlineMaxBytes
- Syntax:
ModPagespeedImageInlineMaxBytes number(Apache) ·pagespeed ImageInlineMaxBytes number;(nginx) - Default:
3072 - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location · also per request (query parameter)
Number of bytes below which images will be inlined.
ImageJpegNumProgressiveScans
- Syntax:
ModPagespeedImageJpegNumProgressiveScans number(Apache) ·pagespeed ImageJpegNumProgressiveScans number;(nginx) - Default:
-1 - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Number of progressive scans [1,10] to emit when rewriting images as ten-scan progressive jpegs. A value of -1 outputs all progressive scans.
ImageJpegNumProgressiveScansForSmallScreens
- Syntax:
ModPagespeedImageJpegNumProgressiveScansForSmallScreens number(Apache) ·pagespeed ImageJpegNumProgressiveScansForSmallScreens number;(nginx) - Default:
-1 - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Number of progressive scans [1,10] to emit when rewriting images asten-scan progressive jpegs for small screens. A value of -1 falls back to kImageJpegNumProgressiveScans.
ImageLimitOptimizedPercent
- Syntax:
ModPagespeedImageLimitOptimizedPercent number(Apache) ·pagespeed ImageLimitOptimizedPercent number;(nginx) - Default:
100 - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Replace images whose size after recompression is less than the given percent of original image size; 100 means replace if smaller.
ImageLimitRenderedAreaPercent
- Syntax:
ModPagespeedImageLimitRenderedAreaPercent number(Apache) ·pagespeed ImageLimitRenderedAreaPercent number;(nginx) - Default:
95 - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Limit on percentage of rendered image wxh to the original image wxh that should be stored in the property cache. This is to avoid corner cases where rounding off decreases the rendered image size by a few pixels.
ImageLimitResizeAreaPercent
- Syntax:
ModPagespeedImageLimitResizeAreaPercent number(Apache) ·pagespeed ImageLimitResizeAreaPercent number;(nginx) - Default:
100 - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Consider resizing images whose area in pixels is less than the given percent of original image area; 100 means replace if smaller.
ImageMaxRewritesAtOnce
- Syntax:
ModPagespeedImageMaxRewritesAtOnce number(Apache) ·pagespeed ImageMaxRewritesAtOnce number;(nginx) - Default:
8 - Context: Apache: server config, virtual host (tolerated) · nginx: http
Set bound on number of images being rewritten at one time (0 = unbounded).
ImageProvenanceCarry
- Syntax:
ModPagespeedImageProvenanceCarry on|off(Apache) ·pagespeed ImageProvenanceCarry on|off;(nginx) - Default:
off - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Provenance carry-through: when true (and PreserveImageProvenance is on), PNG images carrying a C2PA / Content Credentials manifest are recompressed AND their original manifest chunks (caBX/iTXt) are carried into the optimized output unmodified, keeping both the byte savings and the provenance. (Manifest-bearing JPEGs already carry their APP11/JUMBF through recompression under PreserveImageProvenance.) Cases where the carrier cannot be preserved byte-exactly — resize, format conversion (PNG->JPEG/WebP), GIF, or extraction failure — fall back to the default detect-and-skip pass-through. No effect when PreserveImageProvenance is false.
ImageRecompressionQuality
- Syntax:
ModPagespeedImageRecompressionQuality number(Apache) ·pagespeed ImageRecompressionQuality number;(nginx) - Default:
85 - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location · also per request (query parameter)
Set quality parameter for recompressing images [-1,100], 100 refers to best quality, -1 disables lossy compression. JpegRecompressionQuality and WebpRecompressionQuality override this.
ImageResolutionLimitBytes
- Syntax:
ModPagespeedImageResolutionLimitBytes number(Apache) ·pagespeed ImageResolutionLimitBytes number;(nginx) - Default:
33554432 - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Maximum byte size of an image for optimization
InlineOnlyCriticalImages
- Syntax:
ModPagespeedInlineOnlyCriticalImages on|off(Apache) ·pagespeed InlineOnlyCriticalImages on|off;(nginx) - Default:
on - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Inline only critical images
JpegQualityForSaveData
- Syntax:
ModPagespeedJpegQualityForSaveData number(Apache) ·pagespeed JpegQualityForSaveData number;(nginx) - Default:
50 - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location · also per request (query parameter)
Set quality for the images which will be optimized to JPEG format in the Save-Data mode. Use a value in [0,100] to explicitly set the quality. Use -1 to ignore the Save-Data header.
JpegRecompressionQuality
- Syntax:
ModPagespeedJpegRecompressionQuality number(Apache) ·pagespeed JpegRecompressionQuality number;(nginx) - Default:
-1 - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location · also per request (query parameter)
Set quality parameter for recompressing jpeg images [-1,100], 100 is lossless, -1 uses ImageRecompressionQuality
JpegRecompressionQualityForSmallScreens
- Syntax:
ModPagespeedJpegRecompressionQualityForSmallScreens number(Apache) ·pagespeed JpegRecompressionQualityForSmallScreens number;(nginx) - Default:
70 - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location · also per request (query parameter)
Set quality parameter for recompressing jpeg images for small screens. [-1,100], 100 refers to best quality, -1 falls back to ImageJpegRecompressionQuality.
LazyloadImagesAfterOnload
- Syntax:
ModPagespeedLazyloadImagesAfterOnload on|off(Apache) ·pagespeed LazyloadImagesAfterOnload on|off;(nginx) - Default:
on - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Wait until page onload before loading lazy images
LazyloadImagesBlankUrl
- Syntax:
ModPagespeedLazyloadImagesBlankUrl value(Apache) ·pagespeed LazyloadImagesBlankUrl value;(nginx) - Default:
(empty) - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
URL of image used to display prior to loading the lazy image. Empty means use a site-local copy.
LazyloadImagesMode
- Syntax:
ModPagespeedLazyloadImagesMode auto|native|js(Apache) ·pagespeed LazyloadImagesMode auto|native|js;(nginx) - Default:
auto - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
How to lazyload images: ‘native’ annotates non-critical images with loading=“lazy”, ‘js’ uses the JavaScript loader, and ‘auto’ (the default) picks per user agent.
LazyloadImagesSkipFirst
- Syntax:
ModPagespeedLazyloadImagesSkipFirst number(Apache) ·pagespeed LazyloadImagesSkipFirst number;(nginx) - Default:
1 - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Number of leading images to leave untouched when critical image data is unavailable, protecting likely LCP candidates.
MaxImageSizeLowResolutionBytes
- Syntax:
ModPagespeedMaxImageSizeLowResolutionBytes number(Apache) ·pagespeed MaxImageSizeLowResolutionBytes number;(nginx) - Default:
1048576 - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Maximum image size below which low resolution image is generated.
MaxInlinedPreviewImagesIndex
- Syntax:
ModPagespeedMaxInlinedPreviewImagesIndex number(Apache) ·pagespeed MaxInlinedPreviewImagesIndex number;(nginx) - Default:
-1 - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Number of first N images for which low resolution image is generated. Negative values result in generation for all images.
MaxLowResImageSizeBytes
- Syntax:
pagespeed MaxLowResImageSizeBytes number;(nginx) - Default:
-1 - Context: nginx: http, server, location
- Platform: nginx only
The module source carries no help text for this option.
MaxLowResToHighResImageSizePercentage
- Syntax:
pagespeed MaxLowResToHighResImageSizePercentage number;(nginx) - Default:
100 - Context: nginx: http, server, location
- Platform: nginx only
The module source carries no help text for this option.
MinImageSizeLowResolutionBytes
- Syntax:
ModPagespeedMinImageSizeLowResolutionBytes number(Apache) ·pagespeed MinImageSizeLowResolutionBytes number;(nginx) - Default:
3072 - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Minimum image size above which low resolution image is generated.
PreserveImageProvenance
- Syntax:
ModPagespeedPreserveImageProvenance on|off(Apache) ·pagespeed PreserveImageProvenance on|off;(nginx) - Default:
on - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Preserve C2PA/Content-Credentials provenance metadata (JPEG APP11/JUMBF) through image optimization. On by default; independent of EXIF stripping.
ProgressiveJpegMinBytes
- Syntax:
ModPagespeedProgressiveJpegMinBytes number(Apache) ·pagespeed ProgressiveJpegMinBytes number;(nginx) - Default:
10240 - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Minimum size in bytes for converting a jpeg to progressive
ResponsiveImageDensities
- Syntax:
ModPagespeedResponsiveImageDensities value(Apache) ·pagespeed ResponsiveImageDensities value;(nginx) - Default:
1.5,2,3 - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Comma separated list of screen densities to target with ResponsiveImageFilter srcsets.
ServeRewrittenAvifUrlsToAnyAgent
- Syntax:
ModPagespeedServeRewrittenAvifUrlsToAnyAgent on|off(Apache) ·pagespeed ServeRewrittenAvifUrlsToAnyAgent on|off;(nginx) - Default:
on - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Serve rewritten .avif images to any user-agent
ServeRewrittenWebpUrlsToAnyAgent
- Syntax:
ModPagespeedServeRewrittenWebpUrlsToAnyAgent on|off(Apache) ·pagespeed ServeRewrittenWebpUrlsToAnyAgent on|off;(nginx) - Default:
on - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Serve rewritten .webp images to any user-agent
UseBlankImageForInlinePreview
- Syntax:
ModPagespeedUseBlankImageForInlinePreview on|off(Apache) ·pagespeed UseBlankImageForInlinePreview on|off;(nginx) - Default:
off - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Use a blank image for inline preview
WebpAnimatedRecompressionQuality
- Syntax:
ModPagespeedWebpAnimatedRecompressionQuality number(Apache) ·pagespeed WebpAnimatedRecompressionQuality number;(nginx) - Default:
70 - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location · also per request (query parameter)
Quality for rewritten animated webp images [-1,100], 100 refers to best quality, -1 uses ImageRecompressionQuality.
WebpQualityForSaveData
- Syntax:
ModPagespeedWebpQualityForSaveData number(Apache) ·pagespeed WebpQualityForSaveData number;(nginx) - Default:
50 - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location · also per request (query parameter)
Set quality for the images which will be optimized to lossy WebP format in the Save-Data mode. Use a value in [0,100] to explicitly set the quality. Use -1 to ignore the Save-Data header.
WebpRecompressionQuality
- Syntax:
ModPagespeedWebpRecompressionQuality number(Apache) ·pagespeed WebpRecompressionQuality number;(nginx) - Default:
80 - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location · also per request (query parameter)
Quality for rewritten webp images [-1,100], 100 refers to best quality, -1 uses ImageRecompressionQuality.
WebpRecompressionQualityForSmallScreens
- Syntax:
ModPagespeedWebpRecompressionQualityForSmallScreens number(Apache) ·pagespeed WebpRecompressionQualityForSmallScreens number;(nginx) - Default:
70 - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location · also per request (query parameter)
Quality for rewritten webp images for small screens. [-1,100], 100 refers to best quality, -1 falls back to WebpRecompressionQuality.
WebpTimeoutMs
- Syntax:
pagespeed WebpTimeoutMs number;(nginx) - Default:
-1 - Context: nginx: http
- Platform: nginx only
The module source carries no help text for this option.
CSS
AlwaysRewriteCss, CriticalCssAboveTheFoldOnly, CssFlattenMaxBytes, CssInlineMaxBytes, CssOutlineMinBytes, GoogleFontCssInlineMaxBytes, MaxCombinedCssBytes, PermitIdsForCssCombining, TestOnlyPrioritizeCriticalCssDontApplyOriginalCss
AlwaysRewriteCss
- Syntax:
pagespeed AlwaysRewriteCss on|off;(nginx) - Default:
off - Context: nginx: http, server, location
- Platform: nginx only
The module source carries no help text for this option.
CriticalCssAboveTheFoldOnly
- Syntax:
ModPagespeedCriticalCssAboveTheFoldOnly on|off(Apache) ·pagespeed CriticalCssAboveTheFoldOnly on|off;(nginx) - Default:
off - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Makes prioritize_critical_css inline only the rules for content in the first screen instead of the rules for the whole page. The inline block is smaller; content further down may be shown partly styled until the full stylesheet has arrived.
CssFlattenMaxBytes
- Syntax:
ModPagespeedCssFlattenMaxBytes number(Apache) ·pagespeed CssFlattenMaxBytes number;(nginx) - Default:
1024000 - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location · also per request (query parameter)
Number of bytes below which stylesheets will be flattened.
CssInlineMaxBytes
- Syntax:
ModPagespeedCssInlineMaxBytes number(Apache) ·pagespeed CssInlineMaxBytes number;(nginx) - Default:
2048 - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location · also per request (query parameter)
Number of bytes below which stylesheets will be inlined.
CssOutlineMinBytes
- Syntax:
ModPagespeedCssOutlineMinBytes number(Apache) ·pagespeed CssOutlineMinBytes number;(nginx) - Default:
3000 - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Number of bytes above which inline CSS resources will be outlined.
GoogleFontCssInlineMaxBytes
- Syntax:
ModPagespeedGoogleFontCssInlineMaxBytes number(Apache) ·pagespeed GoogleFontCssInlineMaxBytes number;(nginx) - Default:
49152 - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location · also per request (query parameter)
Number of bytes below which Google Font stylesheets will be inlined.
MaxCombinedCssBytes
- Syntax:
ModPagespeedMaxCombinedCssBytes number(Apache) ·pagespeed MaxCombinedCssBytes number;(nginx) - Default:
-1 - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location · also per request (query parameter)
Maximum size allowed for the combined CSS resource.
PermitIdsForCssCombining
- Syntax:
ModPagespeedPermitIdsForCssCombining wildcard(Apache) ·pagespeed PermitIdsForCssCombining wildcard;(nginx) - Default: —
- Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Allow combining CSS files with IDs matching wildcard
TestOnlyPrioritizeCriticalCssDontApplyOriginalCss
- Syntax:
ModPagespeedTestOnlyPrioritizeCriticalCssDontApplyOriginalCss on|off(Apache) ·pagespeed TestOnlyPrioritizeCriticalCssDontApplyOriginalCss on|off;(nginx) - Default:
off - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Stops the prioritize_critical_css filter from invoking its JavaScript that applies all the ‘hidden’ CSS at onload. Intended for testing.
JavaScript
AvoidRenamingIntrospectiveJavascript, ClearInheritedScripts, EnableDeferJsExperimental, EnablePrioritizingScripts, JsInlineMaxBytes, JsOutlineMinBytes, Library, MaxCombinedJsBytes, ProcessScriptVariables, UseAnalyticsJs
AvoidRenamingIntrospectiveJavascript
- Syntax:
ModPagespeedAvoidRenamingIntrospectiveJavascript on|off(Apache) ·pagespeed AvoidRenamingIntrospectiveJavascript on|off;(nginx) - Default:
on - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Don’t combine, inline, cache extend, or otherwise modify javascript in ways that require changing the URL if we see introspection in the form of document.getElementsByTagName(‘script’).
ClearInheritedScripts
- Syntax:
pagespeed ClearInheritedScripts;(nginx) - Default: —
- Context: nginx: http, server, location
- Platform: nginx only
Drops the script-variable directive lines inherited from the enclosing block, so this block starts from the non-scripted configuration.
EnableDeferJsExperimental
- Syntax:
ModPagespeedEnableDeferJsExperimental on|off(Apache) ·pagespeed EnableDeferJsExperimental on|off;(nginx) - Default:
off - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Enable experimental options in defer javascript.
EnablePrioritizingScripts
- Syntax:
pagespeed EnablePrioritizingScripts on|off;(nginx) - Default:
off - Context: nginx: http, server, location
- Platform: nginx only
The module source carries no help text for this option.
JsInlineMaxBytes
- Syntax:
ModPagespeedJsInlineMaxBytes number(Apache) ·pagespeed JsInlineMaxBytes number;(nginx) - Default:
2048 - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location · also per request (query parameter)
Number of bytes below which javascript will be inlined.
JsOutlineMinBytes
- Syntax:
ModPagespeedJsOutlineMinBytes number(Apache) ·pagespeed JsOutlineMinBytes number;(nginx) - Default:
3000 - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Number of bytes above which inline Javascript resources willbe outlined.
Library
- Syntax:
ModPagespeedLibrary bytes md5 canonical_url(Apache) ·pagespeed Library bytes md5 canonical_url;(nginx) - Default: —
- Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Recognizes a JavaScript library by size and hash so canonicalize_javascript_libraries can replace it with the given canonical URL.
MaxCombinedJsBytes
- Syntax:
ModPagespeedMaxCombinedJsBytes number(Apache) ·pagespeed MaxCombinedJsBytes number;(nginx) - Default:
92160 - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Maximum size allowed for the combined JavaScript resource.
ProcessScriptVariables
- Syntax:
pagespeed ProcessScriptVariables on|off|all;(nginx) - Default: —
- Context: nginx: http
- Platform: nginx only
Evaluate nginx script variables ($var) in pagespeed directive arguments at request time: off, on (the LoadFromFile*, EnableFilters, DisableFilters, DownstreamCache* and ShardDomain directives) or all (every query- and directory-scoped option too). Settable once, at the top level.
UseAnalyticsJs
- Syntax:
ModPagespeedUseAnalyticsJs on|off(Apache) ·pagespeed UseAnalyticsJs on|off;(nginx) - Default:
on - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location · also per request (query parameter)
Log to analytics.js instead of ga.js with insert_ga.
Caching
AsyncMetadataL2Writes, AwaitPcacheLookup, CacheFlushFilename, CacheFlushPollIntervalSec, CacheFragment, CompressMetadataCache, CreateSharedMemoryMetadataCache, CycloneRamCacheKb, CycloneZeroCopy, CycloneZeroCopyServe, DefaultCacheHtml, DefaultSharedMemoryCacheKB, DownstreamCachePurgeLocationPrefix, DownstreamCachePurgeMethod, DownstreamCacheRebeaconingKey, DownstreamCacheRewrittenPercentageThreshold, EnableCachePurge, FileCachePath, FileCacheSizeKb, FileCacheSmallTierPercent, FinderPropertiesCacheExpirationTimeMs, FinderPropertiesCacheRefreshTimeMs, ForceCaching, HttpCacheCompressionLevel, ImplicitCacheTtlMs, LRUCacheByteLimit, LRUCacheKbPerProcess, MaxCacheableContentLength, MaxHtmlCacheTimeMs, MemcachedServers, MemcachedThreads, MemcachedTimeoutUs, MetadataCacheStalenessThresholdMs, MinResourceCacheTimeToRewriteMs, NonCacheablesForCachePartialHtml, OverrideCachingTtlMs, PubliclyCacheMismatchedHashesExperimental, PurgeMethod, RedisDatabaseIndex, RedisReconnectionDelayMs, RedisServer, RedisTimeoutUs, RedisTTLSec, SharedMemoryLocks, ShmMetadataCacheCheckpointIntervalSec, UseFallbackPropertyCacheValues
AsyncMetadataL2Writes
- Syntax:
ModPagespeedAsyncMetadataL2Writes on|off(Apache) ·pagespeed AsyncMetadataL2Writes on|off;(nginx) - Default:
off - Context: Apache: server config, virtual host · nginx: http, server
Defer the metadata cache’s blocking L2 (disk) write off the rewrite critical path onto a single-thread write-behind queue. Reads and the shared-memory L1 write stay synchronous, so same-machine read-your-writes is preserved. Experimental; off by default.
AwaitPcacheLookup
- Syntax:
pagespeed AwaitPcacheLookup on|off;(nginx) - Default:
off - Context: nginx: http, server
- Platform: nginx only
The module source carries no help text for this option.
CacheFlushFilename
- Syntax:
ModPagespeedCacheFlushFilename value(Apache) ·pagespeed CacheFlushFilename value;(nginx) - Default:
(empty) - Context: Apache: server config, virtual host · nginx: http, server
Name of file to check for timestamp updates used to flush cache. This file will be relative to the ModPagespeedFileCachePath if it does not begin with a slash.
CacheFlushPollIntervalSec
- Syntax:
ModPagespeedCacheFlushPollIntervalSec number(Apache) ·pagespeed CacheFlushPollIntervalSec number;(nginx) - Default:
5 - Context: Apache: server config, virtual host · nginx: http, server
Number of seconds to wait between polling for cache-flush requests
CacheFragment
- Syntax:
ModPagespeedCacheFragment value(Apache) ·pagespeed CacheFragment value;(nginx) - Default:
(empty) - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Set a cache fragment to allow servers with different hostnames to share a cache. Allowed: letters, numbers, underscores, and hyphens.
CompressMetadataCache
- Syntax:
ModPagespeedCompressMetadataCache on|off(Apache) ·pagespeed CompressMetadataCache on|off;(nginx) - Default:
on - Context: Apache: server config, virtual host · nginx: http, server
Whether to compress cache entries before writing them to memory or disk.
CreateSharedMemoryMetadataCache
- Syntax:
ModPagespeedCreateSharedMemoryMetadataCache name size_kb(Apache) ·pagespeed CreateSharedMemoryMetadataCache name size_kb;(nginx) - Default: —
- Context: Apache: server config · nginx: http
Creates a named shared-memory metadata cache of the given size for the virtual hosts whose FileCachePath is that name.
CycloneRamCacheKb
- Syntax:
ModPagespeedCycloneRamCacheKb number(Apache) ·pagespeed CycloneRamCacheKb number;(nginx) - Default:
0 - Context: Apache: server config, virtual host · nginx: http, server
Set the size, in KB, of Cyclone’s internal RAM cache tier, decoupled from LRUCacheKbPerProcess. 0 (the default) disables the RAM tier — reads are served from the memory-mapped volume, which the OS page cache already keeps hot; -1 inherits LRUCacheKbPerProcess.
CycloneZeroCopy
- Syntax:
ModPagespeedCycloneZeroCopy on|off(Apache) ·pagespeed CycloneZeroCopy on|off;(nginx) - Default:
off - Context: Apache: server config, virtual host · nginx: http, server
Serve HTTP cache hits directly from the Cyclone cache’s memory-mapped storage without copying the payload (zero-copy). Off by default on every port; set it on explicitly to opt in.
CycloneZeroCopyServe
- Syntax:
ModPagespeedCycloneZeroCopyServe on|off(Apache) ·pagespeed CycloneZeroCopyServe on|off;(nginx) - Default:
on - Context: Apache: server config, virtual host · nginx: http, server
Carry memory-mapped Cyclone cache-hit bytes into the port output buffer by reference (aliased) instead of copying them; the serve safely copies the tail out before a cache eviction can overwrite it. Engages only once CycloneZeroCopy maps cache values; on Apache the aliased serve is experimental and activates only when this option is explicitly set. Apache aliases only plain-HTTP/1.x main-request 200s of at least 16KB served verbatim (no Range, no deflate/ssl/http2 or other transforming filter), and bytes an output filter parks for a slow client are copied out at that point; everything else serves a verified copy.
DefaultCacheHtml
- Syntax:
pagespeed DefaultCacheHtml on|off;(nginx) - Default:
off - Context: nginx: http, server, location
- Platform: nginx only
The module source carries no help text for this option.
DefaultSharedMemoryCacheKB
- Syntax:
ModPagespeedDefaultSharedMemoryCacheKB number(Apache) ·pagespeed DefaultSharedMemoryCacheKB number;(nginx) - Default:
51200 - Context: Apache: server config, virtual host (tolerated) · nginx: http
Size of the default shared memory cache used by all virtual hosts that don’t use CreateSharedMemoryMetadataCache. Set to 0 to turn off the default shared memory cache.
DownstreamCachePurgeLocationPrefix
- Syntax:
ModPagespeedDownstreamCachePurgeLocationPrefix host:port/path(Apache) ·pagespeed DownstreamCachePurgeLocationPrefix host:port/path;(nginx) - Default: —
- Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
The host
/path prefix to be used for purging requests from the downstream cache.DownstreamCachePurgeMethod
- Syntax:
ModPagespeedDownstreamCachePurgeMethod value(Apache) ·pagespeed DownstreamCachePurgeMethod value;(nginx) - Default:
PURGE - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Method to be used for purging responses from the downstream cache
DownstreamCacheRebeaconingKey
- Syntax:
ModPagespeedDownstreamCacheRebeaconingKey value(Apache) ·pagespeed DownstreamCacheRebeaconingKey value;(nginx) - Default:
(empty) - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
The key used to authenticate rebeaconing requests from downstream caches. The value specified for this key in the pagespeed server config should be used in the caching layer configuration also.
DownstreamCacheRewrittenPercentageThreshold
- Syntax:
ModPagespeedDownstreamCacheRewrittenPercentageThreshold number(Apache) ·pagespeed DownstreamCacheRewrittenPercentageThreshold number;(nginx) - Default:
95 - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Threshold for percentage of rewriting to be finished before the response is served out and simultaneously stored in the downstream cache, beyond which the response will not be purged from the cache evenif more rewriting is possible now
EnableCachePurge
- Syntax:
ModPagespeedEnableCachePurge on|off(Apache) ·pagespeed EnableCachePurge on|off;(nginx) - Default:
off - Context: Apache: server config, virtual host · nginx: http, server
Allows individual resources to be flushed; adding some overhead to the metadata cache
FileCachePath
- Syntax:
ModPagespeedFileCachePath value(Apache) ·pagespeed FileCachePath value;(nginx) - Default:
(empty) - Context: Apache: server config, virtual host · nginx: http, server
Set the path for file cache
FileCacheSizeKb
- Syntax:
ModPagespeedFileCacheSizeKb number(Apache) ·pagespeed FileCacheSizeKb number;(nginx) - Default:
1048576 - Context: Apache: server config, virtual host · nginx: http, server
Set the target size (in kilobytes) for file cache
FileCacheSmallTierPercent
- Syntax:
ModPagespeedFileCacheSmallTierPercent number(Apache) ·pagespeed FileCacheSmallTierPercent number;(nginx) - Default:
10 - Context: Apache: server config, virtual host · nginx: http, server
Percentage of the file cache carved out as a separate small-object volume that protects metadata and property entries from payload churn. 0 disables the tier; values are clamped to [0, 50]. Below roughly 256 MB of total file cache the tier disables itself and entries share the main volume. Applies in the default shared-memory metadata cache configuration; with the shm metadata cache disabled, metadata stays on the main volume.
FinderPropertiesCacheExpirationTimeMs
- Syntax:
ModPagespeedFinderPropertiesCacheExpirationTimeMs number(Apache) ·pagespeed FinderPropertiesCacheExpirationTimeMs number;(nginx) - Default:
7200000 - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Number of ms that beacon results for the critical selector finders should be considered valid.
FinderPropertiesCacheRefreshTimeMs
- Syntax:
pagespeed FinderPropertiesCacheRefreshTimeMs number;(nginx) - Default:
5400000 - Context: nginx: http, server, location
- Platform: nginx only
The module source carries no help text for this option.
ForceCaching
- Syntax:
ModPagespeedForceCaching on|off(Apache) ·pagespeed ForceCaching on|off;(nginx) - Default: —
- Context: Apache: server config · nginx: http
Ignore HTTP cache headers and TTLs
HttpCacheCompressionLevel
- Syntax:
ModPagespeedHttpCacheCompressionLevel number(Apache) ·pagespeed HttpCacheCompressionLevel number;(nginx) - Default:
9 - Context: Apache: server config, virtual host · nginx: http, server
Compression level for HTTPCache. [-1-9] where 0 is off, 1 is minimumcompression, and 9 (the default) is maximum compression.
ImplicitCacheTtlMs
- Syntax:
ModPagespeedImplicitCacheTtlMs number(Apache) ·pagespeed ImplicitCacheTtlMs number;(nginx) - Default:
300000 - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Time in milliseconds to cache resources that lack an Expires or Cache-Control header
LRUCacheByteLimit
- Syntax:
ModPagespeedLRUCacheByteLimit number(Apache) ·pagespeed LRUCacheByteLimit number;(nginx) - Default:
0 - Context: Apache: server config, virtual host · nginx: http, server
Set the maximum byte size entry to store in the per-process in-memory LRU cache
LRUCacheKbPerProcess
- Syntax:
ModPagespeedLRUCacheKbPerProcess number(Apache) ·pagespeed LRUCacheKbPerProcess number;(nginx) - Default:
0 - Context: Apache: server config, virtual host · nginx: http, server
Set the total size, in KB, of the per-process in-memory LRU cache
MaxCacheableContentLength
- Syntax:
ModPagespeedMaxCacheableContentLength number(Apache) ·pagespeed MaxCacheableContentLength number;(nginx) - Default:
16777216 - Context: Apache: server config, virtual host · nginx: http, server
Maximum length of a cacheable response content. To remove this limit, use -1.
MaxHtmlCacheTimeMs
- Syntax:
pagespeed MaxHtmlCacheTimeMs number;(nginx) - Default:
0 - Context: nginx: http, server, location
- Platform: nginx only
The module source carries no help text for this option.
MemcachedServers
- Syntax:
ModPagespeedMemcachedServers value(Apache) ·pagespeed MemcachedServers value;(nginx) - Default:
(empty) - Context: Apache: server config, virtual host · nginx: http, server
Comma-separated list of servers e.g. host1
,host2MemcachedThreads
- Syntax:
ModPagespeedMemcachedThreads number(Apache) ·pagespeed MemcachedThreads number;(nginx) - Default:
1 - Context: Apache: server config, virtual host · nginx: http, server
Number of background threads to use to run memcached fetches
MemcachedTimeoutUs
- Syntax:
ModPagespeedMemcachedTimeoutUs number(Apache) ·pagespeed MemcachedTimeoutUs number;(nginx) - Default:
500000 - Context: Apache: server config, virtual host · nginx: http, server
Maximum time in microseconds to allow for memcached transactions
MetadataCacheStalenessThresholdMs
- Syntax:
pagespeed MetadataCacheStalenessThresholdMs number;(nginx) - Default:
0 - Context: nginx: http, server, location
- Platform: nginx only
The module source carries no help text for this option.
MinResourceCacheTimeToRewriteMs
- Syntax:
pagespeed MinResourceCacheTimeToRewriteMs number;(nginx) - Default:
0 - Context: nginx: http, server, location
- Platform: nginx only
The module source carries no help text for this option.
NonCacheablesForCachePartialHtml
- Syntax:
pagespeed NonCacheablesForCachePartialHtml value;(nginx) - Default:
(empty) - Context: nginx: http, server, location
- Platform: nginx only
The module source carries no help text for this option.
OverrideCachingTtlMs
- Syntax:
pagespeed OverrideCachingTtlMs number;(nginx) - Default:
-1 - Context: nginx: http, server, location
- Platform: nginx only
The module source carries no help text for this option.
PubliclyCacheMismatchedHashesExperimental
- Syntax:
ModPagespeedPubliclyCacheMismatchedHashesExperimental on|off(Apache) ·pagespeed PubliclyCacheMismatchedHashesExperimental on|off;(nginx) - Default:
off - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
When serving a request for a .pagespeed. URL with the wrong hash, allow public caching based on the origin TTL.
PurgeMethod
- Syntax:
ModPagespeedPurgeMethod value(Apache) ·pagespeed PurgeMethod value;(nginx) - Default:
(empty) - Context: Apache: server config, virtual host · nginx: http, server
HTTP method used for Cache Purge requests. Typically this is set to PURGE, but you must ensure that only authorized clients have access to this method.
RedisDatabaseIndex
- Syntax:
ModPagespeedRedisDatabaseIndex number(Apache) ·pagespeed RedisDatabaseIndex number;(nginx) - Default:
0 - Context: Apache: server config, virtual host · nginx: http, server
Redis server database index selection
RedisReconnectionDelayMs
- Syntax:
ModPagespeedRedisReconnectionDelayMs number(Apache) ·pagespeed RedisReconnectionDelayMs number;(nginx) - Default:
1000 - Context: Apache: server config, virtual host · nginx: http, server
Time to wait after unsuccessful reconnection before another attempt (ms)
RedisServer
- Syntax:
ModPagespeedRedisServer value(Apache) ·pagespeed RedisServer value;(nginx) - Default:
(empty) - Context: Apache: server config, virtual host · nginx: http, server
Redis server to use in format: <host>[:<port>]
RedisTimeoutUs
- Syntax:
ModPagespeedRedisTimeoutUs number(Apache) ·pagespeed RedisTimeoutUs number;(nginx) - Default:
50000 - Context: Apache: server config, virtual host · nginx: http, server
Timeout for all Redis operations and connection (us)
RedisTTLSec
- Syntax:
ModPagespeedRedisTTLSec number(Apache) ·pagespeed RedisTTLSec number;(nginx) - Default:
-1 - Context: Apache: server config, virtual host · nginx: http, server
Redis key TTL to use (seconds)
SharedMemoryLocks
- Syntax:
ModPagespeedSharedMemoryLocks on|off(Apache) ·pagespeed SharedMemoryLocks on|off;(nginx) - Default:
on - Context: Apache: server config, virtual host · nginx: http, server
Use shared memory for internal named lock service
ShmMetadataCacheCheckpointIntervalSec
- Syntax:
ModPagespeedShmMetadataCacheCheckpointIntervalSec number(Apache) ·pagespeed ShmMetadataCacheCheckpointIntervalSec number;(nginx) - Default:
300 - Context: Apache: server config · nginx: http
How often to checkpoint the shared memory metadata cache to disk. Set to 0 to turn off checkpointing.
UseFallbackPropertyCacheValues
- Syntax:
ModPagespeedUseFallbackPropertyCacheValues on|off(Apache) ·pagespeed UseFallbackPropertyCacheValues on|off;(nginx) - Default:
off - Context: Apache: server config, virtual host · nginx: http, server
If this is set to true, fallback values will be used from property cache if actual value is not present. Here fallback values means properties which are shared across all requests which have same url if query paramaters are removed. Example: http://www.test.com?a=1 and http://www.test.com?a=2 share same fallback properties though they are two different urls.
Fetching and origins
BlockingRewriteKey, BlockingRewriteRefererUrls, CustomFetchHeader, DangerPermitFetchFromUnknownHosts, ExperimentalMeasurementProxy, FetcherTimeOutMs, FetchHttps, FetchProxy, FetchWithGzip, NativeFetcherMaxKeepaliveRequests, RateLimitBackgroundFetches, SlurpDirectory, SlurpFlushLimit, SlurpReadOnly, SslCertDirectory, SslCertFile, TestProxy, TestProxySlurp, UseNativeFetcher
BlockingRewriteKey
- Syntax:
ModPagespeedBlockingRewriteKey value(Apache) ·pagespeed BlockingRewriteKey value;(nginx) - Default:
(empty) - Context: Apache: server config, virtual host · nginx: http, server
If the X-PSA-Pagespeed-Blocking-Rewrite header is present, and its value matches the configured value, ensure that all rewrites are completed before sending the response to the client.
BlockingRewriteRefererUrls
- Syntax:
ModPagespeedBlockingRewriteRefererUrls wildcard(Apache) ·pagespeed BlockingRewriteRefererUrls wildcard;(nginx) - Default: —
- Context: Apache: server config, virtual host · nginx: http, server
wildcard_spec for referer urls which trigger blocking rewrites
CustomFetchHeader
- Syntax:
ModPagespeedCustomFetchHeader name value(Apache) ·pagespeed CustomFetchHeader name value;(nginx) - Default: —
- Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Adds a request header to every fetch the module makes to an origin.
DangerPermitFetchFromUnknownHosts
- Syntax:
ModPagespeedDangerPermitFetchFromUnknownHosts on|off(Apache) ·pagespeed DangerPermitFetchFromUnknownHosts on|off;(nginx) - Default:
off - Context: Apache: server config · nginx: http
Disable security checks that prohibit fetching from hostnames mod_pagespeed does not know about
ExperimentalMeasurementProxy
- Syntax:
ModPagespeedExperimentalMeasurementProxy https://root.domain password(Apache) - Default: —
- Context: Apache: server config, virtual host
- Platform: Apache only
Experimental measurement proxy mode (Apache only).
FetcherTimeOutMs
- Syntax:
ModPagespeedFetcherTimeOutMs number(Apache) ·pagespeed FetcherTimeOutMs number;(nginx) - Default:
5000 - Context: Apache: server config, virtual host · nginx: http, server
Set internal fetcher timeout in milliseconds
FetchHttps
- Syntax:
ModPagespeedFetchHttps value(Apache) ·pagespeed FetchHttps value;(nginx) - Default:
enable - Context: Apache: server config, virtual host · nginx: http, server
Controls direct fetching of HTTPS resources. Value is comma-separated list of keywords: enable,disable,allow_self_signed,allow_unknown_certificate_authority,allow_certificate_not_yet_valid
FetchProxy
- Syntax:
ModPagespeedFetchProxy value(Apache) ·pagespeed FetchProxy value;(nginx) - Default:
(empty) - Context: Apache: server config, virtual host · nginx: http, server
Set the fetch proxy
FetchWithGzip
- Syntax:
ModPagespeedFetchWithGzip on|off(Apache) ·pagespeed FetchWithGzip on|off;(nginx) - Default:
off - Context: Apache: server config, virtual host (tolerated) · nginx: http
Request http content from origin servers using gzip
NativeFetcherMaxKeepaliveRequests
- Syntax:
pagespeed NativeFetcherMaxKeepaliveRequests number;(nginx) - Default: —
- Context: nginx: http
- Platform: nginx only
Maximum number of requests the native fetcher sends over one keep-alive connection before it opens a new one (a positive integer).
RateLimitBackgroundFetches
- Syntax:
ModPagespeedRateLimitBackgroundFetches on|off(Apache) ·pagespeed RateLimitBackgroundFetches on|off;(nginx) - Default:
on - Context: Apache: server config, virtual host · nginx: http, server
Rate-limit the number of background HTTP fetches done at once
SlurpDirectory
- Syntax:
ModPagespeedSlurpDirectory value(Apache) ·pagespeed SlurpDirectory value;(nginx) - Default:
(empty) - Context: Apache: server config, virtual host · nginx: http, server
Directory from which to read slurped resources
SlurpFlushLimit
- Syntax:
ModPagespeedSlurpFlushLimit number(Apache) ·pagespeed SlurpFlushLimit number;(nginx) - Default:
0 - Context: Apache: server config, virtual host · nginx: http, server
Set the maximum byte size for the slurped content to hold before a flush
SlurpReadOnly
- Syntax:
ModPagespeedSlurpReadOnly on|off(Apache) ·pagespeed SlurpReadOnly on|off;(nginx) - Default:
off - Context: Apache: server config, virtual host · nginx: http, server
Only read from the slurped directory, fail to fetch URLs not already in the slurped directory
SslCertDirectory
- Syntax:
ModPagespeedSslCertDirectory value(Apache) ·pagespeed SslCertDirectory value;(nginx) - Default:
(empty) - Context: Apache: server config, virtual host · nginx: http, server
Directory to find SSL certificates.
SslCertFile
- Syntax:
ModPagespeedSslCertFile value(Apache) ·pagespeed SslCertFile value;(nginx) - Default:
(empty) - Context: Apache: server config, virtual host · nginx: http, server
File with SSL certificates.
TestProxy
- Syntax:
ModPagespeedTestProxy on|off(Apache) ·pagespeed TestProxy on|off;(nginx) - Default:
off - Context: Apache: server config, virtual host · nginx: http, server
Direct non-PageSpeed URLs to a fetcher, acting as a simple proxy. Meant for test use only
TestProxySlurp
- Syntax:
ModPagespeedTestProxySlurp value(Apache) ·pagespeed TestProxySlurp value;(nginx) - Default:
(empty) - Context: Apache: server config, virtual host · nginx: http, server
If set, the fetcher used by the TestProxy mode will be a readonly slurp fetcher from the given directory
UseNativeFetcher
- Syntax:
pagespeed UseNativeFetcher on|off;(nginx) - Default: —
- Context: nginx: http
- Platform: nginx only
Use nginx’s own event-driven fetcher for the resource fetches the module makes, instead of the built-in serf fetcher.
Settable in the http block only. The native fetcher handles HTTP and HTTPS
fetches.
HTML rewriting and page hints
AmpLinkPattern, BeaconReinstrumentTimeSec, BeaconUrl, EnableExtendedInstrumentation, FlushBufferLimitBytes, FlushHtml, FollowFlushes, IdleFlushTimeMs, LowercaseHtmlNames, MaxHtmlParseBytes, RetainComment
AmpLinkPattern
- Syntax:
pagespeed AmpLinkPattern value;(nginx) - Default:
(empty) - Context: nginx: http, server, location
- Platform: nginx only
The module source carries no help text for this option.
BeaconReinstrumentTimeSec
- Syntax:
ModPagespeedBeaconReinstrumentTimeSec number(Apache) ·pagespeed BeaconReinstrumentTimeSec number;(nginx) - Default:
5 - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
How often (in seconds) to reinstrument pages with beacons. This is used for both critical image beaconing, and for the prioritize_critical_css filter.
BeaconUrl
- Syntax:
ModPagespeedBeaconUrl value(Apache) ·pagespeed BeaconUrl value;(nginx) - Default:
/mod_pagespeed_beacon - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
URL for beacon callback injected by add_instrumentation.
EnableExtendedInstrumentation
- Syntax:
ModPagespeedEnableExtendedInstrumentation on|off(Apache) ·pagespeed EnableExtendedInstrumentation on|off;(nginx) - Default:
off - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
If set to true, addition instrumentation js is added to that page that the beacon can collect more information.
FlushBufferLimitBytes
- Syntax:
pagespeed FlushBufferLimitBytes number;(nginx) - Default:
102400 - Context: nginx: http, server, location
- Platform: nginx only
The module source carries no help text for this option.
FlushHtml
- Syntax:
ModPagespeedFlushHtml on|off(Apache) ·pagespeed FlushHtml on|off;(nginx) - Default:
off - Context: Apache: server config, virtual host · nginx: http, server
Enable auto-flush heuristics for HTML in full proxy mode
FollowFlushes
- Syntax:
ModPagespeedFollowFlushes on|off(Apache) ·pagespeed FollowFlushes on|off;(nginx) - Default:
on - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Attempt to mirror incoming flushes for html streams in the output when ProxyFetch is used.
IdleFlushTimeMs
- Syntax:
pagespeed IdleFlushTimeMs number;(nginx) - Default:
10 - Context: nginx: http, server, location
- Platform: nginx only
The module source carries no help text for this option.
LowercaseHtmlNames
- Syntax:
ModPagespeedLowercaseHtmlNames on|off(Apache) ·pagespeed LowercaseHtmlNames on|off;(nginx) - Default:
off - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Lowercase tag and attribute names for HTML.
When enabled, HTML tag and attribute names are lowercased during parsing.
MaxHtmlParseBytes
- Syntax:
ModPagespeedMaxHtmlParseBytes number(Apache) ·pagespeed MaxHtmlParseBytes number;(nginx) - Default:
-1 - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Maximum number of bytes of HTML that we parse, before redirecting to ?ModPagespeed=off
RetainComment
- Syntax:
ModPagespeedRetainComment wildcard(Apache) ·pagespeed RetainComment wildcard;(nginx) - Default: —
- Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Retain HTML comments matching wildcard, even with remove_comments enabled
Threads and limits
NumExpensiveRewriteThreads, NumRewriteThreads
NumExpensiveRewriteThreads
- Syntax:
ModPagespeedNumExpensiveRewriteThreads auto|number(Apache) ·pagespeed NumExpensiveRewriteThreads auto|number;(nginx) - Default: —
- Context: Apache: server config · nginx: http
Threads per process for heavy optimization work such as image transcoding. auto (or 0) sizes the pool from the CPUs the process may use; a positive integer sets it exactly.
Global, like NumRewriteThreads. See Optimization threads.
NumRewriteThreads
- Syntax:
ModPagespeedNumRewriteThreads auto|number(Apache) ·pagespeed NumRewriteThreads auto|number;(nginx) - Default: —
- Context: Apache: server config · nginx: http
Threads per process for short, latency-sensitive optimization work. auto (or 0) sizes the pool from the CPUs the process may use; a positive integer sets it exactly.
Global: set it once per server, not per virtual host or location. How auto
resolves per server, and when to override it, is in
Optimization threads.
Experiments and analytics
AnalyticsID, ContentExperimentID, ContentExperimentVariantID, EnrollExperiment, ExperimentCookieDurationMs, ExperimentSlot, ExperimentSpec, ExperimentVariable, IncreaseSpeedTracking, Noop, RunExperiment
AnalyticsID
- Syntax:
ModPagespeedAnalyticsID value(Apache) ·pagespeed AnalyticsID value;(nginx) - Default:
(empty) - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Google Analytics ID to use on site.
ContentExperimentID
- Syntax:
ModPagespeedContentExperimentID value(Apache) ·pagespeed ContentExperimentID value;(nginx) - Default:
(empty) - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Which Google Analytics content experiment to log to.
ContentExperimentVariantID
- Syntax:
ModPagespeedContentExperimentVariantID value(Apache) ·pagespeed ContentExperimentVariantID value;(nginx) - Default:
(empty) - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Which Google Analytics content experiment variant to log to.
EnrollExperiment
- Syntax:
ModPagespeedEnrollExperiment number(Apache) ·pagespeed EnrollExperiment number;(nginx) - Default:
-2 - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location · also per request (query parameter)
Assign users to a specific experiment setting.
ExperimentCookieDurationMs
- Syntax:
pagespeed ExperimentCookieDurationMs number;(nginx) - Default:
604800000 - Context: nginx: http, server, location
- Platform: nginx only
The module source carries no help text for this option.
ExperimentSlot
- Syntax:
pagespeed ExperimentSlot number;(nginx) - Default:
1 - Context: nginx: http, server, location
- Platform: nginx only
The module source carries no help text for this option.
ExperimentSpec
- Syntax:
ModPagespeedExperimentSpec spec(Apache) ·pagespeed ExperimentSpec spec;(nginx) - Default: —
- Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Configuration for one side of an experiment in the form: ‘id= ;enabled= ;disabled= ;ga= ;percent= …’
ExperimentVariable
- Syntax:
ModPagespeedExperimentVariable slot(Apache) ·pagespeed ExperimentVariable slot;(nginx) - Default: —
- Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Specify the custom variable slot with which to run experiments.Defaults to 1.
IncreaseSpeedTracking
- Syntax:
ModPagespeedIncreaseSpeedTracking on|off(Apache) ·pagespeed IncreaseSpeedTracking on|off;(nginx) - Default:
on - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Increase the percentage of sites that have Google Analytics page speed tracking
Noop
- Syntax:
ModPagespeedNoop number(Apache) ·pagespeed Noop number;(nginx) - Default:
0 - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location · also per request (query parameter)
Meaningless integer option for browser cache-busting in query-params
RunExperiment
- Syntax:
ModPagespeedRunExperiment on|off(Apache) ·pagespeed RunExperiment on|off;(nginx) - Default:
off - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Run an experiment to test the effectiveness of rewriters.
Deprecated and ignored
AllowVaryOn, CollectRefererStatistics, DisableForBots, DistributedRewriteKey, DistributedRewriteServers, DistributedRewriteTimeoutMs, DistributeFetches, ExperimentalCentralControllerPort, ExperimentalPopularityContestMaxInFlight, ExperimentalPopularityContestMaxQueueSize, FetchFromModSpdy, FileCacheCleanIntervalMs, FileCacheInodeLimit, GeneratedFilePrefix, HashRefererStatistics, If, ImageWebpRecompressionQuality, ImageWebpRecompressionQualityForSmallScreens, ImgInlineMaxBytes, ImgMaxRewritesAtOnce, InheritVHostConfig, MaxPrefetchJsElements, NumShards, PrivateNotVaryForIE, RefererStatisticsOutputLevel, StatisticsLoggingFile, UrlPrefix, UseExperimentalJsMinifier
AllowVaryOn
- Syntax:
ModPagespeedAllowVaryOn value(Apache) ·pagespeed AllowVaryOn value;(nginx) - Default:
(empty) - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Deprecated and ignored: in-place optimization no longer varies its output by request header.
CollectRefererStatistics
- Syntax:
ModPagespeedCollectRefererStatistics value(Apache) - Default: —
- Context: Apache: server config, virtual host, directory, .htaccess
- Platform: Apache only
Removed option; the name is still accepted and ignored.
DisableForBots
- Syntax:
ModPagespeedDisableForBots value(Apache) - Default: —
- Context: Apache: server config, virtual host, directory, .htaccess
- Platform: Apache only
Removed option; the name is still accepted and ignored.
DistributedRewriteKey
- Syntax:
ModPagespeedDistributedRewriteKey value(Apache) ·pagespeed DistributedRewriteKey value;(nginx) - Default: —
- Context: Apache: server config, virtual host · nginx: http, server
Removed option; the name is still accepted and ignored.
DistributedRewriteServers
- Syntax:
ModPagespeedDistributedRewriteServers value(Apache) ·pagespeed DistributedRewriteServers value;(nginx) - Default: —
- Context: Apache: server config, virtual host · nginx: http, server
Removed option; the name is still accepted and ignored.
DistributedRewriteTimeoutMs
- Syntax:
ModPagespeedDistributedRewriteTimeoutMs value(Apache) ·pagespeed DistributedRewriteTimeoutMs value;(nginx) - Default: —
- Context: Apache: server config, virtual host · nginx: http, server
Removed option; the name is still accepted and ignored.
DistributeFetches
- Syntax:
ModPagespeedDistributeFetches value(Apache) ·pagespeed DistributeFetches value;(nginx) - Default: —
- Context: Apache: server config, virtual host · nginx: http, server
Removed option; the name is still accepted and ignored.
ExperimentalCentralControllerPort
- Syntax:
ModPagespeedExperimentalCentralControllerPort value(Apache) ·pagespeed ExperimentalCentralControllerPort value;(nginx) - Default:
(empty) - Context: Apache: server config · nginx: http
Deprecated and ignored: the experimental gRPC central controller was removed
ExperimentalPopularityContestMaxInFlight
- Syntax:
ModPagespeedExperimentalPopularityContestMaxInFlight number(Apache) ·pagespeed ExperimentalPopularityContestMaxInFlight number;(nginx) - Default:
10 - Context: Apache: server config · nginx: http
Deprecated and ignored: the experimental gRPC central controller was removed
ExperimentalPopularityContestMaxQueueSize
- Syntax:
ModPagespeedExperimentalPopularityContestMaxQueueSize number(Apache) ·pagespeed ExperimentalPopularityContestMaxQueueSize number;(nginx) - Default:
1000 - Context: Apache: server config · nginx: http
Deprecated and ignored: the experimental gRPC central controller was removed
FetchFromModSpdy
- Syntax:
ModPagespeedFetchFromModSpdy value(Apache) - Default: —
- Context: Apache: server config, virtual host
- Platform: Apache only
Removed option; the name is still accepted and ignored.
FileCacheCleanIntervalMs
- Syntax:
ModPagespeedFileCacheCleanIntervalMs value(Apache) ·pagespeed FileCacheCleanIntervalMs value;(nginx) - Default: —
- Context: Apache: server config, virtual host · nginx: http, server
Removed option; the name is still accepted and ignored.
FileCacheInodeLimit
- Syntax:
ModPagespeedFileCacheInodeLimit value(Apache) ·pagespeed FileCacheInodeLimit value;(nginx) - Default: —
- Context: Apache: server config, virtual host · nginx: http, server
Removed option; the name is still accepted and ignored.
GeneratedFilePrefix
- Syntax:
ModPagespeedGeneratedFilePrefix value(Apache) - Default: —
- Context: Apache: server config, virtual host
- Platform: Apache only
Removed option; the name is still accepted and ignored.
HashRefererStatistics
- Syntax:
ModPagespeedHashRefererStatistics value(Apache) - Default: —
- Context: Apache: server config, virtual host, directory, .htaccess
- Platform: Apache only
Removed option; the name is still accepted and ignored.
If
- Syntax:
<ModPagespeedIf spdy|!spdy>(Apache) - Default: —
- Context: Apache: server config, virtual host
- Platform: Apache only
Conditionally apply some mod_pagespeed options. Possible arguments: spdy, !spdy
ImageWebpRecompressionQuality
- Syntax:
ModPagespeedImageWebpRecompressionQuality number(Apache) ·pagespeed ImageWebpRecompressionQuality number;(nginx) - Default: —
- Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location · also per request (query parameter)
Former name of WebpRecompressionQuality; accepted and mapped to it.
ImageWebpRecompressionQualityForSmallScreens
- Syntax:
ModPagespeedImageWebpRecompressionQualityForSmallScreens number(Apache) ·pagespeed ImageWebpRecompressionQualityForSmallScreens number;(nginx) - Default: —
- Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location · also per request (query parameter)
Former name of WebpRecompressionQualityForSmallScreens; accepted and mapped to it.
ImgInlineMaxBytes
- Syntax:
ModPagespeedImgInlineMaxBytes number(Apache) - Default: —
- Context: Apache: server config, virtual host, directory, .htaccess · also per request (query parameter)
- Platform: Apache only
Former name of ImageInlineMaxBytes; accepted and mapped to it.
ImgMaxRewritesAtOnce
- Syntax:
ModPagespeedImgMaxRewritesAtOnce number(Apache) - Default: —
- Context: Apache: server config, virtual host (tolerated)
- Platform: Apache only
Former name of ImageMaxRewritesAtOnce; accepted and mapped to it.
InheritVHostConfig
- Syntax:
ModPagespeedInheritVHostConfig value(Apache) - Default: —
- Context: Apache: server config, virtual host
- Platform: Apache only
Removed option; the name is still accepted and ignored.
MaxPrefetchJsElements
- Syntax:
ModPagespeedMaxPrefetchJsElements value(Apache) ·pagespeed MaxPrefetchJsElements value;(nginx) - Default: —
- Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Removed option; the name is still accepted and ignored.
NumShards
- Syntax:
ModPagespeedNumShards value(Apache) - Default: —
- Context: Apache: server config, virtual host
- Platform: Apache only
Removed option; the name is still accepted and ignored.
PrivateNotVaryForIE
- Syntax:
ModPagespeedPrivateNotVaryForIE on|off(Apache) ·pagespeed PrivateNotVaryForIE on|off;(nginx) - Default:
on - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Deprecated and ignored: in-place optimized resources are no longer browser-dependent, so they are never served as Cache-Control: private and never carry a Vary header.
RefererStatisticsOutputLevel
- Syntax:
ModPagespeedRefererStatisticsOutputLevel value(Apache) - Default: —
- Context: Apache: server config, virtual host, directory, .htaccess
- Platform: Apache only
Removed option; the name is still accepted and ignored.
StatisticsLoggingFile
- Syntax:
ModPagespeedStatisticsLoggingFile value(Apache) - Default: —
- Context: Apache: server config, virtual host, directory, .htaccess
- Platform: Apache only
Removed option; the name is still accepted and ignored.
UrlPrefix
- Syntax:
ModPagespeedUrlPrefix value(Apache) - Default: —
- Context: Apache: server config, virtual host
- Platform: Apache only
Removed option; the name is still accepted and ignored.
UseExperimentalJsMinifier
- Syntax:
ModPagespeedUseExperimentalJsMinifier on|off(Apache) ·pagespeed UseExperimentalJsMinifier on|off;(nginx) - Default:
on - Context: Apache: server config, virtual host, directory, .htaccess · nginx: http, server, location
Deprecated and ignored: the legacy JavaScript minifier was removed; the tokenizer-based minifier is the only JavaScript minifier
Deprecated since v1.15.0+r21: the tokenizer-based minifier is the only JavaScript minifier. The directive is accepted for compatibility, ignored, and logs a deprecation warning at configuration load. Remove it from your configuration.
Optimization threads
Optimization work runs on two thread pools, separate from the threads that serve
requests. The rewrite pool handles short, latency-sensitive bookkeeping; the
expensive rewrite pool handles heavy CPU work such as image transcoding, so a
large image cannot hold up everything else. This is the in-process module’s own
thread configuration; the optimizer worker’s --num-threads and
--ram-cache-size flags are a different setting, on the
worker page.
In v1.15.0+r21 and later both pools size themselves.
NumRewriteThreads and
NumExpensiveRewriteThreads default to auto,
and mod_pagespeed resolves them at startup by:
- Taking the CPUs the process is actually permitted to use — not the host’s core count. A CPU quota (a container limit or a systemd unit) and a CPU affinity mask both count. A 2-CPU container on a 64-core host sees 2.
- Allowing optimization at most half of those.
- Dividing by the number of peer processes the server is configured to run, because each process builds its own pools. Without this step a server with many children would multiply its thread count by the number of children.
- Giving the result to each pool, never fewer than one thread.
The resolved counts, and the numbers they were derived from, are written to the error log at startup.
What this means per server
Apache reports its configured child-process ceiling, so the divisor is real:
MaxRequestWorkers / ThreadsPerChild on worker and event, and
MaxRequestWorkers on prefork — in both cases capped by ServerLimit. If you
have lowered ServerLimit, that is the number in effect, not the division.
A stock event configuration allows 400 workers at 25 threads per child, so the
divisor is 16 and a server resolves to one thread per pool unless it has a
great many cores. That is the intended answer: the ceiling counts children the
server is allowed to start, and sizing each child as though it were alone on
the machine is what oversubscribes it. A server deliberately configured with few
children on a many-core machine gets proportionally more.
prefork is not threaded and resolves to one thread per pool, as it always has.
nginx does not yet report a process count to the module, so it resolves to one thread per pool and logs that it fell back. It never assumes a larger divisor: guessing high would silently oversubscribe the machine, which is worse than being conservative.
This is unchanged from earlier releases. If you have set NumRewriteThreads or
NumExpensiveRewriteThreads explicitly, your values continue to apply exactly
as before.
The IIS module sizes its own pools and does not yet consult these directives. Its behaviour is unchanged in this release. See IIS tuning.
Setting the counts explicitly
An explicit positive value overrides the computed one entirely.
| Value | Effect |
|---|---|
auto | Resolve as described above. This is the default. |
0 | An alias for auto. |
| positive integer | Use exactly this many threads per process, ignoring the computation. |
| negative | Rejected when the configuration is read. |
A negative value is rejected at configuration-read time rather than being clamped, which on Apache means the server does not start. Very large explicit values are capped, with a warning naming both the value you asked for and the value in effect.
ModPagespeedNumRewriteThreads 4
ModPagespeedNumExpensiveRewriteThreads 4
pagespeed NumRewriteThreads 4;
pagespeed NumExpensiveRewriteThreads 4;
Both directives are global. They cannot be set per virtual host or per location: the pools are built once per process, before any virtual host is consulted.
When to change them
Most servers should leave these alone. Reach for them when the log line at startup shows a resolved count that does not match your deployment — most often a single-process server on a many-core machine, or a server whose configured child ceiling is far above the number of children it will really run.
If you raise them, watch request latency rather than only optimization throughput. The reason optimization is capped at half the machine is that the remaining half is serving traffic.
URL segment length limits
MaxSegmentLength sets the maximum length (in characters)
of any single URL segment — the text between two / separators — that the
module will produce when it combines or rewrites resources.
Apache servers historically capped URL segments at about 250 characters per
segment. mod_pagespeed circumvents that limit when running under Apache, but
intermediate proxies or CDNs in front of your origin may re-impose it. If a
downstream component rejects long .pagespeed. URLs, lower this value so
mod_pagespeed produces shorter combined URLs.
pagespeed MaxSegmentLength 250;
ModPagespeedMaxSegmentLength 250
pagespeed MaxSegmentLength 250
This directive applies only to the URLs mod_pagespeed generates (for example, when combining CSS or JavaScript). It does not limit which inbound request URLs the module will rewrite.
Behind a reverse proxy
When mod_pagespeed runs behind a reverse proxy (such as nginx, Varnish, or a CDN), keep the following in mind:
- The proxy must forward the original
Hostheader to the backend so that mod_pagespeed generates correct URLs for optimized resources. - If the proxy terminates TLS, configure mod_pagespeed to recognize the
X-Forwarded-Protoheader (RespectXForwardedProto) so that it generateshttps://URLs for optimized resources. See HTTPS configuration for the details. - Ensure that
.pagespeed.resource URLs are routed to the backend running mod_pagespeed. The proxy must not cache these resources independently unless you configure cache lifetimes carefully. - If the proxy strips or modifies response headers, verify that
mod_pagespeed’s
X-Mod-PagespeedorX-Page-Speedheader andCache-Controldirectives pass through intact.
See also CDN integration.
See also
- Filter selection — rewrite levels and enabling or disabling filters
- PageSpeed filters — every filter, what it does and which level enables it
- Cache modes and Domain configuration
- Worker and reverse-proxy configuration — the Docker shape and the optimizer worker
- PageSpeed markers reference — the attributes and headers these directives produce at runtime
Frequently asked questions
Where is the mod_pagespeed configuration file?
Apache reads pagespeed.conf from /etc/apache2/mods-available/ (Debian, Ubuntu) or /etc/httpd/conf.d/ (RHEL, AlmaLinux, Rocky); nginx reads pagespeed directives from nginx.conf, in the http, server or location block; IIS reads pagespeed.config from the site root or %ProgramData%\We-Amp\PageSpeed\.
What is the minimal working configuration?
On Apache, ModPagespeed on and a writable ModPagespeedFileCachePath; the packaged pagespeed.conf already sets both. On nginx, load_module modules/ngx_pagespeed_module.so;, pagespeed on; and pagespeed FileCachePath /var/cache/ngx_pagespeed; in the server block, plus the three location blocks that let the module serve its own resources. On IIS, pagespeed on in pagespeed.config.
How do I write the same directive for Apache, nginx and IIS?
Prefix the directive name with ModPagespeed on Apache (ModPagespeedEnableFilters rewrite_images); on nginx write pagespeed followed by the name and a semicolon (pagespeed EnableFilters rewrite_images;); on IIS use the nginx form without the semicolon in pagespeed.config.
How do I turn mod_pagespeed off for one path?
Scope the switch: ModPagespeed off inside a <Location> or <Directory> block on Apache, pagespeed off; inside a location block on nginx, or a Disallow directive for a URL wildcard on any server.