Note

The module is not supported in the current version of ISPmanager for the OpenLiteSpeed web server.

PageSpeed module automatically optimizes website pages and speeds up their loading. To install the module, enable the PageSpeed Module option when installing the web server. ISPmanager installs separate versions of the module for Apache and Nginx. Read more in Install a web-server.

For the web server to use the module for website pages, enable the PageSpeed Module option in the website settings. Read more in Add a WWW-domain.

If you use custom Nginx templates, add the following lines to /usr/local/mgr5/etc/templates/nginx-vhosts.template and /usr/local/mgr5/etc/templates/nginx-vhosts-ssl.template to activate the module:

{% if $PAGESPEED == on %}
        include {% $NGINX_MODULE_PAGESPEED_PATH %};
{% endif %}
CODE

ISPmanager uses default module configurations. You can change module settings through configuration files. Read more in the official module documentation.

Note.

An error in the module configuration may cause the web server to become inoperable. We do not recommend changing the configuration files unless you are absolutely sure.

Module configuration for Nginx

Module configuration file — /etc/nginx/conf.d/pagespeed.conf.

The contents of the default configuration file:

pagespeed off;
pagespeed FileCachePath /var/ngx_pagespeed_cache;
pagespeed FileCacheSizeKb 102400;
pagespeed FileCacheCleanIntervalMs 3600000;
pagespeed FileCacheInodeLimit 500000;
CODE

When enabling a module for the website, a string is added to the Nginx configuration file for the WWW domain:

include /etc/nginx/modules-includes/pagespeed/*.conf;
CODE

This string connects the configuration file /etc/nginx/modules-includes/pagespeed/pagespeed.conf with the following content:

pagespeed on;

location ~ "\.pagespeed\.([a-z]\.)?[a-z]{2}\.[^.]{10}\.[^.]+" {
  add_header "" "";
}
location ~ "^/pagespeed_static/" { }
location ~ "^/ngx_pagespeed_beacon$" { }
CODE

Module configuration for Apache

Module configuration files:

  • for Debian, Ubuntu — /etc/apache2/mods-enabled/pagespeed.conf, /etc/apache2/mods-enabled.pagespeed.load;
  • for AlmaLinux, CentOS, VzLinux — /etc/httpd/conf.d/pagespeed.conf.

The main parameters of the default configuration file:

ModPagespeed off
ModPagespeedFileCachePath "/var/cache/mod_pagespeed/"
ModPagespeedFileCacheSizeKb 102400
ModPagespeedFileCacheCleanIntervalMs 3600000
ModPagespeedFileCacheInodeLimit 500000
CODE

When enabling a module for the website, a string is added to the Apache configuration file for the WWW domain:

<IfModule pagespeed_module>
    ModPagespeed on
</IfModule>
CODE