Skip to main content

Upgrading from Open-Source

Step-by-step guide to replacing Google's open-source mod_pagespeed with the maintained 1.1 release. Drop-in compatible — keep your existing config.

Overview

mod_pagespeed 1.1 is a drop-in replacement for Google’s open-source mod_pagespeed. The upgrade takes a few minutes:

  1. Stop your web server
  2. Replace the module binary
  3. Start your web server

That’s it. Your existing configuration, filters, and .htaccess rules continue to work.

Before you start

Check your current version:

curl -I http://localhost/ | grep X-PageSpeed

Back up your current module in case you want to roll back:

# nginx
sudo cp /usr/lib/nginx/modules/ngx_pagespeed_module.so /usr/lib/nginx/modules/ngx_pagespeed_module.so.bak

# Apache
sudo cp /usr/lib/apache2/modules/mod_pagespeed.so /usr/lib/apache2/modules/mod_pagespeed.so.bak

Upgrade steps

nginx

# 1. Stop nginx
sudo systemctl stop nginx

# 2. Replace the module
sudo cp ngx_pagespeed_module.so /usr/lib/nginx/modules/

# 3. Start nginx
sudo systemctl start nginx

# 4. Verify
curl -I http://localhost/ | grep X-PageSpeed
# Should show: X-PageSpeed: 1.1.0

Apache

# 1. Stop Apache
sudo systemctl stop apache2

# 2. Replace the module
sudo cp mod_pagespeed.so /usr/lib/apache2/modules/

# 3. Start Apache
sudo systemctl start apache2

# 4. Verify
curl -I http://localhost/ | grep X-PageSpeed

IIS

  1. Uninstall the existing IISpeed or mod_pagespeed module from IIS Manager
  2. Install the mod_pagespeed 1.1 module
  3. Restart IIS: iisreset

Cache migration

mod_pagespeed 1.1 uses Cyclone Cache, a new cache backend. On first start after the upgrade:

  • The old file cache is ignored (not deleted)
  • Cyclone Cache starts fresh with an empty cache
  • Resources are re-optimized on first request — expect a brief warm-up period

You can safely delete the old cache directory after confirming the upgrade works:

# Check your config for the cache path, then:
sudo rm -rf /var/cache/mod_pagespeed/  # or wherever your old cache lived

Configuration compatibility

All existing directives are supported. A few notes:

DirectiveStatus
pagespeed on/offWorks as before
pagespeed RewriteLevelWorks as before
pagespeed EnableFiltersAll 40+ filters available
pagespeed DisableFiltersWorks as before
pagespeed DomainWorks as before
pagespeed MapOriginDomainWorks as before
pagespeed FileCachePathAccepted — Cyclone Cache uses its own storage

The FileCachePath directive is still accepted for compatibility but mod_pagespeed 1.1 uses Cyclone Cache for storage. You can remove it from your config if you prefer.

Rolling back

If you need to revert to the open-source version:

# Restore the backup you made earlier
sudo systemctl stop nginx
sudo cp /usr/lib/nginx/modules/ngx_pagespeed_module.so.bak /usr/lib/nginx/modules/ngx_pagespeed_module.so
sudo systemctl start nginx

Getting help