Skip to content

pagespeed: PageSpeed dynamic module for NGINX

Reference documentation

The full directive and filter reference for nginx-module-pagespeed lives on our RPM-docs site at nginx-extras.getpagespeed.com/modules/pagespeed/. Behaviour and directives are identical across the RPM and APT packages, so the same reference applies to both. We host that reference ourselves (mirrored from the archived Apache incubator-pagespeed-mod project) because the original modpagespeed.com domain is now operated by an unrelated commercial vendor.

Debian/Ubuntu installation

These docs apply to the APT package nginx-module-pagespeed provided by the GetPageSpeed Extras repository.

  1. Configure the APT repository as described in APT repository setup.
  2. Install the module:
sudo apt-get update
sudo apt-get install nginx-module-pagespeed
Show suites and architectures
| Distro   | Suite             | Component   | Architectures   |
|----------|-------------------|-------------|-----------------|
| debian   | bookworm          | main        | amd64           |
| debian   | bookworm-mainline | main        | amd64           |
| debian   | trixie            | main        | amd64           |
| debian   | trixie-mainline   | main        | amd64           |
| ubuntu   | focal             | main        | amd64           |
| ubuntu   | focal-mainline    | main        | amd64           |
| ubuntu   | jammy             | main        | amd64           |
| ubuntu   | jammy-mainline    | main        | amd64           |
| ubuntu   | noble             | main        | amd64           |
| ubuntu   | noble-mainline    | main        | amd64           |

Enable the module by adding the following at the top of /etc/nginx/nginx.conf:

load_module modules/ngx_pagespeed.so;

The ngx_pagespeed v2 beta is currently RPM-only (opt-in testing channel — see the RPM-site landing for the enable command). A DEB v2 beta is planned but not yet shipping; the APT package above remains on the stable 1.x line.


ngx_pagespeed speeds up your site and reduces page load time by automatically applying web performance best practices to pages and associated assets (CSS, JavaScript, images) without requiring you to modify your existing content or workflow. Features include:

  • Image optimization: stripping meta-data, dynamic resizing, recompression
  • CSS & JavaScript minification, concatenation, inlining, and outlining
  • Small resource inlining
  • Deferring image and JavaScript loading
  • HTML rewriting
  • Cache lifetime extension
  • … and many more filters

How to configure

Start with the module configuration guide, then jump to specific reference pages: