Updated: 28 September 2026 · Applies to: Nginx 1.24+

Google's PageSpeed module for Nginx (ngx_pagespeed) is no longer developed, and Nginx 1.12 and CentOS 7 are long out of support. We no longer recommend building Nginx with it.

What to use instead

  • Current Nginx from your distribution or nginx.org (dnf install nginx / apt install nginx).
  • Compression: gzip on; (and Brotli where available).
  • Caching: long expires headers for static files, and FastCGI or application caching for pages.
  • Images: serve WebP/AVIF and set width and height attributes.
  • A CDN for visitors far from your server.

Example

gzip on;
gzip_types text/css application/javascript application/json image/svg+xml;
location ~* \.(css|js|jpg|jpeg|png|webp|svg|woff2)$ {
    expires 30d;
    add_header Cache-Control "public";
}

Related services

KVM VPS hosting

NVMe SSD and full root access, with Free Basic Managed Support.

Unmanaged dedicated servers

full root access and free IPMI KVM, with Free Basic Managed Support.

Managed dedicated servers

our engineers look after the server for you, from $135 a month.

Was this answer helpful?

Still stuck? Open a ticket