# Configuration reference: Apache and nginx directives

Every mod_pagespeed 2.1 directive for the native Apache and nginx module, generated from the source: syntax, default, context and description.

Canonical URL: https://modpagespeed.com/docs/configuration/

> **Running the Docker image or the worker?**
>
> This page is the reference for the **native module**: the in-process
> `mod_pagespeed` for Apache and nginx (and the IIS module, which reads the same
> directives). If you run the `pagespeed-nginx` image, the Helm chart or the
> optimizer worker beside a thin nginx, the 16 `pagespeed_*` directives and the
> worker's command-line flags are on
> [Worker and reverse-proxy configuration](https://modpagespeed.com/docs/worker-configuration/).

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

<!-- platform: nginx -->

**nginx**

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;`.

<!-- platform: apache -->

**Apache**

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`.

<!-- platform: iis -->

**IIS**

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](https://modpagespeed.com/docs/iis-configuration/) for match rules and the file
format.

## Minimal working configuration

<!-- platform: nginx -->

**nginx**

```nginx
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$" { }
    }
}
```

<!-- platform: apache -->

**Apache**

```apache
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.

<!-- platform: iis -->

**IIS**

```text
pagespeed on
```

With that in place the module runs the CoreFilters set. Everything below is
optional: pick a different [rewrite level](https://modpagespeed.com/docs/configuration/#rewritelevel), add or remove
[filters](https://modpagespeed.com/docs/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](https://modpagespeed.com/analyze/).

## 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|off` is a boolean (`true`/`false` also work),
  `number` an integer, `value` a string, `wildcard` a 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: the `http`, `server` and `location` blocks. "Also per request"
  marks the options that can also be set on a single request with a
  `PageSpeed…` 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](https://modpagespeed.com/docs/release-notes/).

The nginx versions each shape runs on are in one table on the
[worker and reverse-proxy page](https://modpagespeed.com/docs/worker-configuration/#which-nginx-version).

## Module states

The module switch, [`pagespeed` / `ModPagespeed`](https://modpagespeed.com/docs/configuration/#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.                             |

<!-- platform: nginx -->

**nginx**

```nginx
pagespeed standby;
```

On nginx, `pagespeed off;` is an alias for `unplugged`.

<!-- platform: apache -->

**Apache**

```apache
ModPagespeed standby
```

<!-- platform: iis -->

**IIS**

```text
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.

<!-- platform: apache -->

**Apache**

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.

```apache
<Location /images/>
    ModPagespeedDisableFilters convert_jpeg_to_webp
</Location>
```

<!-- platform: nginx -->

**nginx**

In nginx, use `server` and `location` blocks to scope directives:

```nginx
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.

<!-- platform: iis -->

**IIS**

See [IIS configuration](https://modpagespeed.com/docs/iis-configuration/#path-based-matching-with-regex)
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.

<!-- platform: nginx -->

**nginx**

```nginx
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;
}
```

<!-- platform: apache -->

**Apache**

```apache
<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>
```

<!-- platform: iis -->

**IIS**

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`):

```text
pagespeed on
pagespeed EnableFilters rewrite_images
```

**Site B** (`C:\inetpub\site-b\pagespeed.config`):

```text
pagespeed on
pagespeed EnableFilters collapse_whitespace
```

Alternatively, use match rules in the server-level config to scope directives
by hostname:

```text
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](https://github.com/We-Amp/pagespeed-optimizer/blob/main/website/src/data/reference/source-pin.json)
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.

<!-- generated:begin module-directives -->

Areas: [Enabling and filter selection](https://modpagespeed.com/docs/configuration/#area-enabling-and-filter-selection) (13) · [Request handling and policy](https://modpagespeed.com/docs/configuration/#area-request-handling-and-policy) (33) · [In-place resource optimization](https://modpagespeed.com/docs/configuration/#area-in-place-resource-optimization) (14) · [Domains and URLs](https://modpagespeed.com/docs/configuration/#area-domains-and-urls) (26) · [Optimizer worker](https://modpagespeed.com/docs/configuration/#area-optimizer-worker) (4) · [Bot authentication and licensing](https://modpagespeed.com/docs/configuration/#area-bot-authentication-and-licensing) (19) · [Statistics, console and logging](https://modpagespeed.com/docs/configuration/#area-statistics-console-and-logging) (31) · [Images](https://modpagespeed.com/docs/configuration/#area-images) (42) · [CSS](https://modpagespeed.com/docs/configuration/#area-css) (9) · [JavaScript](https://modpagespeed.com/docs/configuration/#area-javascript) (10) · [Caching](https://modpagespeed.com/docs/configuration/#area-caching) (46) · [Fetching and origins](https://modpagespeed.com/docs/configuration/#area-fetching-and-origins) (19) · [HTML rewriting and page hints](https://modpagespeed.com/docs/configuration/#area-html-rewriting-and-page-hints) (11) · [Threads and limits](https://modpagespeed.com/docs/configuration/#area-threads-and-limits) (2) · [Experiments and analytics](https://modpagespeed.com/docs/configuration/#area-experiments-and-analytics) (11) · [Deprecated and ignored](https://modpagespeed.com/docs/configuration/#area-deprecated-and-ignored) (28).

### Enabling and filter selection

[`Allow`](https://modpagespeed.com/docs/configuration/#allow), [`DisableFilters`](https://modpagespeed.com/docs/configuration/#disablefilters), [`Disallow`](https://modpagespeed.com/docs/configuration/#disallow), [`EnableAggressiveRewritersForMobile`](https://modpagespeed.com/docs/configuration/#enableaggressiverewritersformobile), [`EnableFilters`](https://modpagespeed.com/docs/configuration/#enablefilters), [`EnableRewriting`](https://modpagespeed.com/docs/configuration/#enablerewriting), [`ForbidAllDisabledFilters`](https://modpagespeed.com/docs/configuration/#forbidalldisabledfilters), [`ForbidFilters`](https://modpagespeed.com/docs/configuration/#forbidfilters), [`ModPagespeed`](https://modpagespeed.com/docs/configuration/#modpagespeed), [`RewriteDeadlinePerFlushMs`](https://modpagespeed.com/docs/configuration/#rewritedeadlineperflushms), [`RewriteLevel`](https://modpagespeed.com/docs/configuration/#rewritelevel), [`RewriteRandomDropPercentage`](https://modpagespeed.com/docs/configuration/#rewriterandomdroppercentage), [`RewriteUncacheableResources`](https://modpagespeed.com/docs/configuration/#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](https://modpagespeed.com/docs/filter-selection/#disablefilters).

#### 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](https://modpagespeed.com/docs/worker-configuration/#pagespeed_disallow).

#### 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](https://modpagespeed.com/docs/filters/). See
[Filter selection](https://modpagespeed.com/docs/filter-selection/#enablefilters) 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](https://modpagespeed.com/docs/filter-selection/#forbidalldisabledfilters).

#### 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](https://modpagespeed.com/docs/filter-selection/#forbidfilters).

#### 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](https://modpagespeed.com/docs/filter-selection/#rewritelevel).

#### 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`](https://modpagespeed.com/docs/configuration/#acceptinvalidsignatures), [`AccessControlAllowOrigins`](https://modpagespeed.com/docs/configuration/#accesscontrolalloworigins), [`AddOptionsToUrls`](https://modpagespeed.com/docs/configuration/#addoptionstourls), [`AddResourceHeader`](https://modpagespeed.com/docs/configuration/#addresourceheader), [`AgentOptimize`](https://modpagespeed.com/docs/configuration/#agentoptimize), [`AllowLoggingUrlsInLogRecord`](https://modpagespeed.com/docs/configuration/#allowloggingurlsinlogrecord), [`AllowOptionsToBeSetByCookies`](https://modpagespeed.com/docs/configuration/#allowoptionstobesetbycookies), [`CombineAcrossPaths`](https://modpagespeed.com/docs/configuration/#combineacrosspaths), [`DisableBackgroundFetchesForBots`](https://modpagespeed.com/docs/configuration/#disablebackgroundfetchesforbots), [`DisableRewriteOnNoTransform`](https://modpagespeed.com/docs/configuration/#disablerewriteonnotransform), [`ExperimentalProxyAllRequests`](https://modpagespeed.com/docs/configuration/#experimentalproxyallrequests), [`ForceBuffering`](https://modpagespeed.com/docs/configuration/#forcebuffering), [`HideRefererUsingMeta`](https://modpagespeed.com/docs/configuration/#hiderefererusingmeta), [`HonorCsp`](https://modpagespeed.com/docs/configuration/#honorcsp), [`InlineResourcesWithoutExplicitAuthorization`](https://modpagespeed.com/docs/configuration/#inlineresourceswithoutexplicitauthorization), [`ModifyCachingHeaders`](https://modpagespeed.com/docs/configuration/#modifycachingheaders), [`ObliviousPagespeedUrls`](https://modpagespeed.com/docs/configuration/#obliviouspagespeedurls), [`OptionCookiesDurationMs`](https://modpagespeed.com/docs/configuration/#optioncookiesdurationms), [`PreserveSubresourceHints`](https://modpagespeed.com/docs/configuration/#preservesubresourcehints), [`ProxyAuth`](https://modpagespeed.com/docs/configuration/#proxyauth), [`RejectBlacklisted`](https://modpagespeed.com/docs/configuration/#rejectblacklisted), [`RejectBlacklistedStatusCode`](https://modpagespeed.com/docs/configuration/#rejectblacklistedstatuscode), [`RequestOptionOverride`](https://modpagespeed.com/docs/configuration/#requestoptionoverride), [`RespectVary`](https://modpagespeed.com/docs/configuration/#respectvary), [`RespectXForwardedProto`](https://modpagespeed.com/docs/configuration/#respectxforwardedproto), [`ServeStaleIfFetchError`](https://modpagespeed.com/docs/configuration/#servestaleiffetcherror), [`ServeStaleWhileRevalidateThresholdSec`](https://modpagespeed.com/docs/configuration/#servestalewhilerevalidatethresholdsec), [`ServeXhrAccessControlHeaders`](https://modpagespeed.com/docs/configuration/#servexhraccesscontrolheaders), [`StickyQueryParameters`](https://modpagespeed.com/docs/configuration/#stickyqueryparameters), [`SupportNoScriptEnabled`](https://modpagespeed.com/docs/configuration/#supportnoscriptenabled), [`TrackOriginalContentLength`](https://modpagespeed.com/docs/configuration/#trackoriginalcontentlength), [`UrlSigningKey`](https://modpagespeed.com/docs/configuration/#urlsigningkey), [`XHeaderValue`](https://modpagespeed.com/docs/configuration/#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.

```apache
ModPagespeedAddResourceHeader "X-Custom" "value"
```

```nginx
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][:RedirectUrl] -- 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](https://modpagespeed.com/pagespeed-markers/#x-page-speed). The default is the module
version string.

### In-place resource optimization

[`CacheSmallImagesUnrewritten`](https://modpagespeed.com/docs/configuration/#cachesmallimagesunrewritten), [`InPlacePreemptiveRewriteCss`](https://modpagespeed.com/docs/configuration/#inplacepreemptiverewritecss), [`InPlacePreemptiveRewriteCssImages`](https://modpagespeed.com/docs/configuration/#inplacepreemptiverewritecssimages), [`InPlacePreemptiveRewriteImages`](https://modpagespeed.com/docs/configuration/#inplacepreemptiverewriteimages), [`InPlacePreemptiveRewriteJavascript`](https://modpagespeed.com/docs/configuration/#inplacepreemptiverewritejavascript), [`InPlaceResourceOptimization`](https://modpagespeed.com/docs/configuration/#inplaceresourceoptimization), [`InPlaceRewriteDeadlineMs`](https://modpagespeed.com/docs/configuration/#inplacerewritedeadlinems), [`InPlaceSMaxAgeSec`](https://modpagespeed.com/docs/configuration/#inplacesmaxagesec), [`InPlaceWaitForOptimized`](https://modpagespeed.com/docs/configuration/#inplacewaitforoptimized), [`IproMaxConcurrentRecordings`](https://modpagespeed.com/docs/configuration/#ipromaxconcurrentrecordings), [`IproMaxResponseBytes`](https://modpagespeed.com/docs/configuration/#ipromaxresponsebytes), [`NoTransformOptimizedImages`](https://modpagespeed.com/docs/configuration/#notransformoptimizedimages), [`ProactivelyFreshenUserFacingRequest`](https://modpagespeed.com/docs/configuration/#proactivelyfreshenuserfacingrequest), [`ProactiveResourceFreshening`](https://modpagespeed.com/docs/configuration/#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`](https://modpagespeed.com/docs/configuration/#clientdomainrewrite), [`CssPreserveURLs`](https://modpagespeed.com/docs/configuration/#csspreserveurls), [`Domain`](https://modpagespeed.com/docs/configuration/#domain), [`DomainRewriteCookies`](https://modpagespeed.com/docs/configuration/#domainrewritecookies), [`DomainRewriteHyperlinks`](https://modpagespeed.com/docs/configuration/#domainrewritehyperlinks), [`DomainShardCount`](https://modpagespeed.com/docs/configuration/#domainshardcount), [`ImagePreserveURLs`](https://modpagespeed.com/docs/configuration/#imagepreserveurls), [`JsPreserveURLs`](https://modpagespeed.com/docs/configuration/#jspreserveurls), [`LoadFromFile`](https://modpagespeed.com/docs/configuration/#loadfromfile), [`LoadFromFileCacheTtlMs`](https://modpagespeed.com/docs/configuration/#loadfromfilecachettlms), [`LoadFromFileMatch`](https://modpagespeed.com/docs/configuration/#loadfromfilematch), [`LoadFromFileRule`](https://modpagespeed.com/docs/configuration/#loadfromfilerule), [`LoadFromFileRuleMatch`](https://modpagespeed.com/docs/configuration/#loadfromfilerulematch), [`MapOriginDomain`](https://modpagespeed.com/docs/configuration/#maporigindomain), [`MapProxyDomain`](https://modpagespeed.com/docs/configuration/#mapproxydomain), [`MapRewriteDomain`](https://modpagespeed.com/docs/configuration/#maprewritedomain), [`MaxSegmentLength`](https://modpagespeed.com/docs/configuration/#maxsegmentlength), [`MaxUrlSize`](https://modpagespeed.com/docs/configuration/#maxurlsize), [`PreserveUrlRelativity`](https://modpagespeed.com/docs/configuration/#preserveurlrelativity), [`ProxySuffix`](https://modpagespeed.com/docs/configuration/#proxysuffix), [`RemoteConfigurationTimeoutMs`](https://modpagespeed.com/docs/configuration/#remoteconfigurationtimeoutms), [`RemoteConfigurationUrl`](https://modpagespeed.com/docs/configuration/#remoteconfigurationurl), [`ShardDomain`](https://modpagespeed.com/docs/configuration/#sharddomain), [`StaticAssetCDN`](https://modpagespeed.com/docs/configuration/#staticassetcdn), [`StaticAssetPrefix`](https://modpagespeed.com/docs/configuration/#staticassetprefix), [`UrlValuedAttribute`](https://modpagespeed.com/docs/configuration/#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 &lt;form&gt; and &lt;a&gt; 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](https://modpagespeed.com/docs/configuration/#max-url-segments).

#### 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`](https://modpagespeed.com/docs/configuration/#daemonapisocketpath), [`DaemonServeStoredEncodings`](https://modpagespeed.com/docs/configuration/#daemonservestoredencodings), [`DaemonSocketPath`](https://modpagespeed.com/docs/configuration/#daemonsocketpath), [`DaemonVolumePath`](https://modpagespeed.com/docs/configuration/#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](https://modpagespeed.com/docs/worker-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](https://modpagespeed.com/docs/worker-configuration/#--cache-dir).

### Bot authentication and licensing

[`RslCapDirectoryHost`](https://modpagespeed.com/docs/configuration/#rslcapdirectoryhost), [`RslCapEnforcement`](https://modpagespeed.com/docs/configuration/#rslcapenforcement), [`RslCapIssuer`](https://modpagespeed.com/docs/configuration/#rslcapissuer), [`RslCapKeyDirectoryAllowlist`](https://modpagespeed.com/docs/configuration/#rslcapkeydirectoryallowlist), [`RslCapKeyDirectoryFile`](https://modpagespeed.com/docs/configuration/#rslcapkeydirectoryfile), [`RslCapKeyDirectoryRefreshSec`](https://modpagespeed.com/docs/configuration/#rslcapkeydirectoryrefreshsec), [`RslCapKeyDirectoryUrl`](https://modpagespeed.com/docs/configuration/#rslcapkeydirectoryurl), [`RslCapRequestedLicense`](https://modpagespeed.com/docs/configuration/#rslcaprequestedlicense), [`RslCapRequestedScope`](https://modpagespeed.com/docs/configuration/#rslcaprequestedscope), [`WebBotAuth`](https://modpagespeed.com/docs/configuration/#webbotauth), [`WebBotAuthBotDetection`](https://modpagespeed.com/docs/configuration/#webbotauthbotdetection), [`WebBotAuthDirectoryHost`](https://modpagespeed.com/docs/configuration/#webbotauthdirectoryhost), [`WebBotAuthKeyDirectoryAllowlist`](https://modpagespeed.com/docs/configuration/#webbotauthkeydirectoryallowlist), [`WebBotAuthKeyDirectoryFile`](https://modpagespeed.com/docs/configuration/#webbotauthkeydirectoryfile), [`WebBotAuthKeyDirectoryRefreshSec`](https://modpagespeed.com/docs/configuration/#webbotauthkeydirectoryrefreshsec), [`WebBotAuthKeyDirectoryUrl`](https://modpagespeed.com/docs/configuration/#webbotauthkeydirectoryurl), [`WebBotAuthPublicCounter`](https://modpagespeed.com/docs/configuration/#webbotauthpubliccounter), [`WebBotAuthTelemetry`](https://modpagespeed.com/docs/configuration/#webbotauthtelemetry), [`WebBotAuthVerifiedBots`](https://modpagespeed.com/docs/configuration/#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](https://modpagespeed.com/docs/rsl-cap/).

#### 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 =&gt; 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 =&gt; 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](https://modpagespeed.com/docs/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[:port]) the warm-fetch may contact. Empty =&gt; 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 =&gt; 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`](https://modpagespeed.com/docs/configuration/#admindomains), [`AdminPath`](https://modpagespeed.com/docs/configuration/#adminpath), [`ConsoleDomains`](https://modpagespeed.com/docs/configuration/#consoledomains), [`ConsolePath`](https://modpagespeed.com/docs/configuration/#consolepath), [`GlobalAdminDomains`](https://modpagespeed.com/docs/configuration/#globaladmindomains), [`GlobalAdminPath`](https://modpagespeed.com/docs/configuration/#globaladminpath), [`GlobalStatisticsDomains`](https://modpagespeed.com/docs/configuration/#globalstatisticsdomains), [`GlobalStatisticsPath`](https://modpagespeed.com/docs/configuration/#globalstatisticspath), [`InstallCrashHandler`](https://modpagespeed.com/docs/configuration/#installcrashhandler), [`ListOutstandingUrlsOnError`](https://modpagespeed.com/docs/configuration/#listoutstandingurlsonerror), [`LogBackgroundRewrite`](https://modpagespeed.com/docs/configuration/#logbackgroundrewrite), [`LogDir`](https://modpagespeed.com/docs/configuration/#logdir), [`LogMobilizationSamples`](https://modpagespeed.com/docs/configuration/#logmobilizationsamples), [`LogRewriteTiming`](https://modpagespeed.com/docs/configuration/#logrewritetiming), [`LogUrlIndices`](https://modpagespeed.com/docs/configuration/#logurlindices), [`MaxRewriteInfoLogSize`](https://modpagespeed.com/docs/configuration/#maxrewriteinfologsize), [`MessageBufferSize`](https://modpagespeed.com/docs/configuration/#messagebuffersize), [`MessagesDomains`](https://modpagespeed.com/docs/configuration/#messagesdomains), [`MessagesPath`](https://modpagespeed.com/docs/configuration/#messagespath), [`ReportUnloadTime`](https://modpagespeed.com/docs/configuration/#reportunloadtime), [`SlowFileLatencyUs`](https://modpagespeed.com/docs/configuration/#slowfilelatencyus), [`Statistics`](https://modpagespeed.com/docs/configuration/#statistics), [`StatisticsDomains`](https://modpagespeed.com/docs/configuration/#statisticsdomains), [`StatisticsLogging`](https://modpagespeed.com/docs/configuration/#statisticslogging), [`StatisticsLoggingChartsCSS`](https://modpagespeed.com/docs/configuration/#statisticsloggingchartscss), [`StatisticsLoggingChartsJS`](https://modpagespeed.com/docs/configuration/#statisticsloggingchartsjs), [`StatisticsLoggingIntervalMs`](https://modpagespeed.com/docs/configuration/#statisticsloggingintervalms), [`StatisticsLoggingMaxFileSizeKb`](https://modpagespeed.com/docs/configuration/#statisticsloggingmaxfilesizekb), [`StatisticsPath`](https://modpagespeed.com/docs/configuration/#statisticspath), [`StrictAdminAccess`](https://modpagespeed.com/docs/configuration/#strictadminaccess), [`UsePerVHostStatistics`](https://modpagespeed.com/docs/configuration/#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`](https://modpagespeed.com/docs/configuration/#avifanimatedrecompressionquality), [`AvifQualityForSaveData`](https://modpagespeed.com/docs/configuration/#avifqualityforsavedata), [`AvifRecompressionQuality`](https://modpagespeed.com/docs/configuration/#avifrecompressionquality), [`AvifRecompressionQualityForSmallScreens`](https://modpagespeed.com/docs/configuration/#avifrecompressionqualityforsmallscreens), [`AvifTimeoutMs`](https://modpagespeed.com/docs/configuration/#aviftimeoutms), [`CriticalImagesBeaconEnabled`](https://modpagespeed.com/docs/configuration/#criticalimagesbeaconenabled), [`CssImageInlineMaxBytes`](https://modpagespeed.com/docs/configuration/#cssimageinlinemaxbytes), [`EnableLazyLoadHighResImages`](https://modpagespeed.com/docs/configuration/#enablelazyloadhighresimages), [`ImageInlineMaxBytes`](https://modpagespeed.com/docs/configuration/#imageinlinemaxbytes), [`ImageJpegNumProgressiveScans`](https://modpagespeed.com/docs/configuration/#imagejpegnumprogressivescans), [`ImageJpegNumProgressiveScansForSmallScreens`](https://modpagespeed.com/docs/configuration/#imagejpegnumprogressivescansforsmallscreens), [`ImageLimitOptimizedPercent`](https://modpagespeed.com/docs/configuration/#imagelimitoptimizedpercent), [`ImageLimitRenderedAreaPercent`](https://modpagespeed.com/docs/configuration/#imagelimitrenderedareapercent), [`ImageLimitResizeAreaPercent`](https://modpagespeed.com/docs/configuration/#imagelimitresizeareapercent), [`ImageMaxRewritesAtOnce`](https://modpagespeed.com/docs/configuration/#imagemaxrewritesatonce), [`ImageProvenanceCarry`](https://modpagespeed.com/docs/configuration/#imageprovenancecarry), [`ImageRecompressionQuality`](https://modpagespeed.com/docs/configuration/#imagerecompressionquality), [`ImageResolutionLimitBytes`](https://modpagespeed.com/docs/configuration/#imageresolutionlimitbytes), [`InlineOnlyCriticalImages`](https://modpagespeed.com/docs/configuration/#inlineonlycriticalimages), [`JpegQualityForSaveData`](https://modpagespeed.com/docs/configuration/#jpegqualityforsavedata), [`JpegRecompressionQuality`](https://modpagespeed.com/docs/configuration/#jpegrecompressionquality), [`JpegRecompressionQualityForSmallScreens`](https://modpagespeed.com/docs/configuration/#jpegrecompressionqualityforsmallscreens), [`LazyloadImagesAfterOnload`](https://modpagespeed.com/docs/configuration/#lazyloadimagesafteronload), [`LazyloadImagesBlankUrl`](https://modpagespeed.com/docs/configuration/#lazyloadimagesblankurl), [`LazyloadImagesMode`](https://modpagespeed.com/docs/configuration/#lazyloadimagesmode), [`LazyloadImagesSkipFirst`](https://modpagespeed.com/docs/configuration/#lazyloadimagesskipfirst), [`MaxImageSizeLowResolutionBytes`](https://modpagespeed.com/docs/configuration/#maximagesizelowresolutionbytes), [`MaxInlinedPreviewImagesIndex`](https://modpagespeed.com/docs/configuration/#maxinlinedpreviewimagesindex), [`MaxLowResImageSizeBytes`](https://modpagespeed.com/docs/configuration/#maxlowresimagesizebytes), [`MaxLowResToHighResImageSizePercentage`](https://modpagespeed.com/docs/configuration/#maxlowrestohighresimagesizepercentage), [`MinImageSizeLowResolutionBytes`](https://modpagespeed.com/docs/configuration/#minimagesizelowresolutionbytes), [`PreserveImageProvenance`](https://modpagespeed.com/docs/configuration/#preserveimageprovenance), [`ProgressiveJpegMinBytes`](https://modpagespeed.com/docs/configuration/#progressivejpegminbytes), [`ResponsiveImageDensities`](https://modpagespeed.com/docs/configuration/#responsiveimagedensities), [`ServeRewrittenAvifUrlsToAnyAgent`](https://modpagespeed.com/docs/configuration/#serverewrittenavifurlstoanyagent), [`ServeRewrittenWebpUrlsToAnyAgent`](https://modpagespeed.com/docs/configuration/#serverewrittenwebpurlstoanyagent), [`UseBlankImageForInlinePreview`](https://modpagespeed.com/docs/configuration/#useblankimageforinlinepreview), [`WebpAnimatedRecompressionQuality`](https://modpagespeed.com/docs/configuration/#webpanimatedrecompressionquality), [`WebpQualityForSaveData`](https://modpagespeed.com/docs/configuration/#webpqualityforsavedata), [`WebpRecompressionQuality`](https://modpagespeed.com/docs/configuration/#webprecompressionquality), [`WebpRecompressionQualityForSmallScreens`](https://modpagespeed.com/docs/configuration/#webprecompressionqualityforsmallscreens), [`WebpTimeoutMs`](https://modpagespeed.com/docs/configuration/#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-&gt;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`](https://modpagespeed.com/docs/configuration/#alwaysrewritecss), [`CriticalCssAboveTheFoldOnly`](https://modpagespeed.com/docs/configuration/#criticalcssabovethefoldonly), [`CssFlattenMaxBytes`](https://modpagespeed.com/docs/configuration/#cssflattenmaxbytes), [`CssInlineMaxBytes`](https://modpagespeed.com/docs/configuration/#cssinlinemaxbytes), [`CssOutlineMinBytes`](https://modpagespeed.com/docs/configuration/#cssoutlineminbytes), [`GoogleFontCssInlineMaxBytes`](https://modpagespeed.com/docs/configuration/#googlefontcssinlinemaxbytes), [`MaxCombinedCssBytes`](https://modpagespeed.com/docs/configuration/#maxcombinedcssbytes), [`PermitIdsForCssCombining`](https://modpagespeed.com/docs/configuration/#permitidsforcsscombining), [`TestOnlyPrioritizeCriticalCssDontApplyOriginalCss`](https://modpagespeed.com/docs/configuration/#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`](https://modpagespeed.com/docs/configuration/#avoidrenamingintrospectivejavascript), [`ClearInheritedScripts`](https://modpagespeed.com/docs/configuration/#clearinheritedscripts), [`EnableDeferJsExperimental`](https://modpagespeed.com/docs/configuration/#enabledeferjsexperimental), [`EnablePrioritizingScripts`](https://modpagespeed.com/docs/configuration/#enableprioritizingscripts), [`JsInlineMaxBytes`](https://modpagespeed.com/docs/configuration/#jsinlinemaxbytes), [`JsOutlineMinBytes`](https://modpagespeed.com/docs/configuration/#jsoutlineminbytes), [`Library`](https://modpagespeed.com/docs/configuration/#library), [`MaxCombinedJsBytes`](https://modpagespeed.com/docs/configuration/#maxcombinedjsbytes), [`ProcessScriptVariables`](https://modpagespeed.com/docs/configuration/#processscriptvariables), [`UseAnalyticsJs`](https://modpagespeed.com/docs/configuration/#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`](https://modpagespeed.com/docs/configuration/#asyncmetadatal2writes), [`AwaitPcacheLookup`](https://modpagespeed.com/docs/configuration/#awaitpcachelookup), [`CacheFlushFilename`](https://modpagespeed.com/docs/configuration/#cacheflushfilename), [`CacheFlushPollIntervalSec`](https://modpagespeed.com/docs/configuration/#cacheflushpollintervalsec), [`CacheFragment`](https://modpagespeed.com/docs/configuration/#cachefragment), [`CompressMetadataCache`](https://modpagespeed.com/docs/configuration/#compressmetadatacache), [`CreateSharedMemoryMetadataCache`](https://modpagespeed.com/docs/configuration/#createsharedmemorymetadatacache), [`CycloneRamCacheKb`](https://modpagespeed.com/docs/configuration/#cycloneramcachekb), [`CycloneZeroCopy`](https://modpagespeed.com/docs/configuration/#cyclonezerocopy), [`CycloneZeroCopyServe`](https://modpagespeed.com/docs/configuration/#cyclonezerocopyserve), [`DefaultCacheHtml`](https://modpagespeed.com/docs/configuration/#defaultcachehtml), [`DefaultSharedMemoryCacheKB`](https://modpagespeed.com/docs/configuration/#defaultsharedmemorycachekb), [`DownstreamCachePurgeLocationPrefix`](https://modpagespeed.com/docs/configuration/#downstreamcachepurgelocationprefix), [`DownstreamCachePurgeMethod`](https://modpagespeed.com/docs/configuration/#downstreamcachepurgemethod), [`DownstreamCacheRebeaconingKey`](https://modpagespeed.com/docs/configuration/#downstreamcacherebeaconingkey), [`DownstreamCacheRewrittenPercentageThreshold`](https://modpagespeed.com/docs/configuration/#downstreamcacherewrittenpercentagethreshold), [`EnableCachePurge`](https://modpagespeed.com/docs/configuration/#enablecachepurge), [`FileCachePath`](https://modpagespeed.com/docs/configuration/#filecachepath), [`FileCacheSizeKb`](https://modpagespeed.com/docs/configuration/#filecachesizekb), [`FileCacheSmallTierPercent`](https://modpagespeed.com/docs/configuration/#filecachesmalltierpercent), [`FinderPropertiesCacheExpirationTimeMs`](https://modpagespeed.com/docs/configuration/#finderpropertiescacheexpirationtimems), [`FinderPropertiesCacheRefreshTimeMs`](https://modpagespeed.com/docs/configuration/#finderpropertiescacherefreshtimems), [`ForceCaching`](https://modpagespeed.com/docs/configuration/#forcecaching), [`HttpCacheCompressionLevel`](https://modpagespeed.com/docs/configuration/#httpcachecompressionlevel), [`ImplicitCacheTtlMs`](https://modpagespeed.com/docs/configuration/#implicitcachettlms), [`LRUCacheByteLimit`](https://modpagespeed.com/docs/configuration/#lrucachebytelimit), [`LRUCacheKbPerProcess`](https://modpagespeed.com/docs/configuration/#lrucachekbperprocess), [`MaxCacheableContentLength`](https://modpagespeed.com/docs/configuration/#maxcacheablecontentlength), [`MaxHtmlCacheTimeMs`](https://modpagespeed.com/docs/configuration/#maxhtmlcachetimems), [`MemcachedServers`](https://modpagespeed.com/docs/configuration/#memcachedservers), [`MemcachedThreads`](https://modpagespeed.com/docs/configuration/#memcachedthreads), [`MemcachedTimeoutUs`](https://modpagespeed.com/docs/configuration/#memcachedtimeoutus), [`MetadataCacheStalenessThresholdMs`](https://modpagespeed.com/docs/configuration/#metadatacachestalenessthresholdms), [`MinResourceCacheTimeToRewriteMs`](https://modpagespeed.com/docs/configuration/#minresourcecachetimetorewritems), [`NonCacheablesForCachePartialHtml`](https://modpagespeed.com/docs/configuration/#noncacheablesforcachepartialhtml), [`OverrideCachingTtlMs`](https://modpagespeed.com/docs/configuration/#overridecachingttlms), [`PubliclyCacheMismatchedHashesExperimental`](https://modpagespeed.com/docs/configuration/#publiclycachemismatchedhashesexperimental), [`PurgeMethod`](https://modpagespeed.com/docs/configuration/#purgemethod), [`RedisDatabaseIndex`](https://modpagespeed.com/docs/configuration/#redisdatabaseindex), [`RedisReconnectionDelayMs`](https://modpagespeed.com/docs/configuration/#redisreconnectiondelayms), [`RedisServer`](https://modpagespeed.com/docs/configuration/#redisserver), [`RedisTimeoutUs`](https://modpagespeed.com/docs/configuration/#redistimeoutus), [`RedisTTLSec`](https://modpagespeed.com/docs/configuration/#redisttlsec), [`SharedMemoryLocks`](https://modpagespeed.com/docs/configuration/#sharedmemorylocks), [`ShmMetadataCacheCheckpointIntervalSec`](https://modpagespeed.com/docs/configuration/#shmmetadatacachecheckpointintervalsec), [`UseFallbackPropertyCacheValues`](https://modpagespeed.com/docs/configuration/#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:port/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:port1,host2:port2

#### MemcachedThreads

- **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: &lt;host&gt;[:&lt;port&gt;]

#### 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`](https://modpagespeed.com/docs/configuration/#blockingrewritekey), [`BlockingRewriteRefererUrls`](https://modpagespeed.com/docs/configuration/#blockingrewriterefererurls), [`CustomFetchHeader`](https://modpagespeed.com/docs/configuration/#customfetchheader), [`DangerPermitFetchFromUnknownHosts`](https://modpagespeed.com/docs/configuration/#dangerpermitfetchfromunknownhosts), [`ExperimentalMeasurementProxy`](https://modpagespeed.com/docs/configuration/#experimentalmeasurementproxy), [`FetcherTimeOutMs`](https://modpagespeed.com/docs/configuration/#fetchertimeoutms), [`FetchHttps`](https://modpagespeed.com/docs/configuration/#fetchhttps), [`FetchProxy`](https://modpagespeed.com/docs/configuration/#fetchproxy), [`FetchWithGzip`](https://modpagespeed.com/docs/configuration/#fetchwithgzip), [`NativeFetcherMaxKeepaliveRequests`](https://modpagespeed.com/docs/configuration/#nativefetchermaxkeepaliverequests), [`RateLimitBackgroundFetches`](https://modpagespeed.com/docs/configuration/#ratelimitbackgroundfetches), [`SlurpDirectory`](https://modpagespeed.com/docs/configuration/#slurpdirectory), [`SlurpFlushLimit`](https://modpagespeed.com/docs/configuration/#slurpflushlimit), [`SlurpReadOnly`](https://modpagespeed.com/docs/configuration/#slurpreadonly), [`SslCertDirectory`](https://modpagespeed.com/docs/configuration/#sslcertdirectory), [`SslCertFile`](https://modpagespeed.com/docs/configuration/#sslcertfile), [`TestProxy`](https://modpagespeed.com/docs/configuration/#testproxy), [`TestProxySlurp`](https://modpagespeed.com/docs/configuration/#testproxyslurp), [`UseNativeFetcher`](https://modpagespeed.com/docs/configuration/#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`](https://modpagespeed.com/docs/configuration/#amplinkpattern), [`BeaconReinstrumentTimeSec`](https://modpagespeed.com/docs/configuration/#beaconreinstrumenttimesec), [`BeaconUrl`](https://modpagespeed.com/docs/configuration/#beaconurl), [`EnableExtendedInstrumentation`](https://modpagespeed.com/docs/configuration/#enableextendedinstrumentation), [`FlushBufferLimitBytes`](https://modpagespeed.com/docs/configuration/#flushbufferlimitbytes), [`FlushHtml`](https://modpagespeed.com/docs/configuration/#flushhtml), [`FollowFlushes`](https://modpagespeed.com/docs/configuration/#followflushes), [`IdleFlushTimeMs`](https://modpagespeed.com/docs/configuration/#idleflushtimems), [`LowercaseHtmlNames`](https://modpagespeed.com/docs/configuration/#lowercasehtmlnames), [`MaxHtmlParseBytes`](https://modpagespeed.com/docs/configuration/#maxhtmlparsebytes), [`RetainComment`](https://modpagespeed.com/docs/configuration/#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`](https://modpagespeed.com/docs/configuration/#numexpensiverewritethreads), [`NumRewriteThreads`](https://modpagespeed.com/docs/configuration/#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](https://modpagespeed.com/docs/configuration/#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](https://modpagespeed.com/docs/configuration/#optimization-threads).

### Experiments and analytics

[`AnalyticsID`](https://modpagespeed.com/docs/configuration/#analyticsid), [`ContentExperimentID`](https://modpagespeed.com/docs/configuration/#contentexperimentid), [`ContentExperimentVariantID`](https://modpagespeed.com/docs/configuration/#contentexperimentvariantid), [`EnrollExperiment`](https://modpagespeed.com/docs/configuration/#enrollexperiment), [`ExperimentCookieDurationMs`](https://modpagespeed.com/docs/configuration/#experimentcookiedurationms), [`ExperimentSlot`](https://modpagespeed.com/docs/configuration/#experimentslot), [`ExperimentSpec`](https://modpagespeed.com/docs/configuration/#experimentspec), [`ExperimentVariable`](https://modpagespeed.com/docs/configuration/#experimentvariable), [`IncreaseSpeedTracking`](https://modpagespeed.com/docs/configuration/#increasespeedtracking), [`Noop`](https://modpagespeed.com/docs/configuration/#noop), [`RunExperiment`](https://modpagespeed.com/docs/configuration/#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`](https://modpagespeed.com/docs/configuration/#allowvaryon), [`CollectRefererStatistics`](https://modpagespeed.com/docs/configuration/#collectrefererstatistics), [`DisableForBots`](https://modpagespeed.com/docs/configuration/#disableforbots), [`DistributedRewriteKey`](https://modpagespeed.com/docs/configuration/#distributedrewritekey), [`DistributedRewriteServers`](https://modpagespeed.com/docs/configuration/#distributedrewriteservers), [`DistributedRewriteTimeoutMs`](https://modpagespeed.com/docs/configuration/#distributedrewritetimeoutms), [`DistributeFetches`](https://modpagespeed.com/docs/configuration/#distributefetches), [`ExperimentalCentralControllerPort`](https://modpagespeed.com/docs/configuration/#experimentalcentralcontrollerport), [`ExperimentalPopularityContestMaxInFlight`](https://modpagespeed.com/docs/configuration/#experimentalpopularitycontestmaxinflight), [`ExperimentalPopularityContestMaxQueueSize`](https://modpagespeed.com/docs/configuration/#experimentalpopularitycontestmaxqueuesize), [`FetchFromModSpdy`](https://modpagespeed.com/docs/configuration/#fetchfrommodspdy), [`FileCacheCleanIntervalMs`](https://modpagespeed.com/docs/configuration/#filecachecleanintervalms), [`FileCacheInodeLimit`](https://modpagespeed.com/docs/configuration/#filecacheinodelimit), [`GeneratedFilePrefix`](https://modpagespeed.com/docs/configuration/#generatedfileprefix), [`HashRefererStatistics`](https://modpagespeed.com/docs/configuration/#hashrefererstatistics), [`If`](https://modpagespeed.com/docs/configuration/#if), [`ImageWebpRecompressionQuality`](https://modpagespeed.com/docs/configuration/#imagewebprecompressionquality), [`ImageWebpRecompressionQualityForSmallScreens`](https://modpagespeed.com/docs/configuration/#imagewebprecompressionqualityforsmallscreens), [`ImgInlineMaxBytes`](https://modpagespeed.com/docs/configuration/#imginlinemaxbytes), [`ImgMaxRewritesAtOnce`](https://modpagespeed.com/docs/configuration/#imgmaxrewritesatonce), [`InheritVHostConfig`](https://modpagespeed.com/docs/configuration/#inheritvhostconfig), [`MaxPrefetchJsElements`](https://modpagespeed.com/docs/configuration/#maxprefetchjselements), [`NumShards`](https://modpagespeed.com/docs/configuration/#numshards), [`PrivateNotVaryForIE`](https://modpagespeed.com/docs/configuration/#privatenotvaryforie), [`RefererStatisticsOutputLevel`](https://modpagespeed.com/docs/configuration/#refererstatisticsoutputlevel), [`StatisticsLoggingFile`](https://modpagespeed.com/docs/configuration/#statisticsloggingfile), [`UrlPrefix`](https://modpagespeed.com/docs/configuration/#urlprefix), [`UseExperimentalJsMinifier`](https://modpagespeed.com/docs/configuration/#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.

<!-- generated:end module-directives -->

## 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](https://modpagespeed.com/docs/worker-configuration/#threading).

In v1.15.0+r21 and later both pools size themselves.
[`NumRewriteThreads`](https://modpagespeed.com/docs/configuration/#numrewritethreads) and
[`NumExpensiveRewriteThreads`](https://modpagespeed.com/docs/configuration/#numexpensiverewritethreads) default to `auto`,
and mod_pagespeed resolves them at startup by:

1. 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.
2. Allowing optimization at most **half** of those.
3. 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.
4. 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**

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**

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.

**IIS**

The IIS module sizes its own pools and does not yet consult these directives.
Its behaviour is unchanged in this release. See
[IIS tuning](https://modpagespeed.com/docs/iis-configuration/#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.

**Apache**

```apache
ModPagespeedNumRewriteThreads 4
ModPagespeedNumExpensiveRewriteThreads 4
```

**nginx**

```nginx
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`](https://modpagespeed.com/docs/configuration/#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.

<!-- platform: nginx -->

**nginx**

```nginx
pagespeed MaxSegmentLength 250;
```

<!-- platform: apache -->

**Apache**

```apache
ModPagespeedMaxSegmentLength 250
```

<!-- platform: iis -->

**IIS**

```text
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 `Host` header 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-Proto` header ([`RespectXForwardedProto`](https://modpagespeed.com/docs/configuration/#respectxforwardedproto))
  so that it generates `https://` URLs for optimized resources. See
  [HTTPS configuration](https://modpagespeed.com/docs/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-Pagespeed` or `X-Page-Speed` header and
  `Cache-Control` directives pass through intact.

See also [CDN integration](https://modpagespeed.com/docs/cdn-integration/).

## See also

- [Filter selection](https://modpagespeed.com/docs/filter-selection/) — rewrite levels and enabling or disabling filters
- [PageSpeed filters](https://modpagespeed.com/docs/filters/) — every filter, what it does and which level enables it
- [Cache modes](https://modpagespeed.com/docs/cache-modes/) and [Domain configuration](https://modpagespeed.com/docs/domain-configuration/)
- [Worker and reverse-proxy configuration](https://modpagespeed.com/docs/worker-configuration/) — the Docker shape and the optimizer worker
- [PageSpeed markers reference](https://modpagespeed.com/pagespeed-markers/) — 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.
