27 July 2019

mod_pagespeed and ngx_pagespeed. Google modules for Apache and NGINX Webserver to improve performance.

How to improve the PageSpeed?

When it comes to loading a website, speed is essential. With modern high-speed internet connections, people generally expect instant results when browsing the web, and if your site loads too slowly, it's likely to shut down and move on to the next one. We need to fix this now; it's a matter of business, lost revenue, and positioning . Speed ​​is no longer an optional extra, but a must for every self-respecting professional website that strives to perform well online.

What is mod_pagespeed?

There are a number of factors that can affect your website's loading speed, from the performance of your server's hardware to the software you run on it and your website's code. While most software installs with a configuration designed to get most users up and running, sometimes it's not as efficient as it could be. When using the Apache web server or the NGINX web server, file serving performance can be improved using Google's mod_pagespeed module . This module performs some optimizations on HTML and JavaScript code to reduce their size, as well as caching modified files to speed up delivery from disk. Pairing it with Memcached allows mod_pagespeed to store modified files in memory rather than on disk, further speeding up file delivery.

When should I use Mod_PageSpeed?

Mod_PageSpeed ​​is a good option for sites facing the following scenarios:

No optimization history – Any optimization is better than no optimization. This module contains many best practices your developers can implement immediately.

Static Sites – If your site is built primarily from static images and content that doesn't change frequently, this module will immediately help by compressing images and making your HTML more user-friendly.

Works alongside your Apache or Nginx servers – This is a server plugin for these specific web servers. Great for media companies and other content-heavy sites that host and manage their own servers.

No budget for speed – If you've spent all your money on a CDN, this module is a good option for front-end optimization because it's open source. However, it requires system administrators to install, configure, and update it as your website changes.

But there are no WordPress plugins to increase speed?

If you've just asked yourself this question, know that you're probably right, but from your point of view. In fact, you take for granted that everyone uses CMS such as WordPress, Joomla, Drupal, Magento, where there are already plugins to achieve good performance on the application side. In truth, there are custom sites that have been developed without taking into account an optimization on the application side and as they are not modular, they do not have the possibility to install any plugin or module for performance at the application level.

In these cases either you completely review the code, the javascript and so on, or you rely on mod_pagespeed which will do the optimization for you in an absolutely transparent way without having to put your hand to a single line of code for your application.

Even where you use Plugin for WordPress, maybe you would like to improve the functionality by eliminating some expensive and onerous plugins (from the point of view of server load and PHP speed) to delegate the main optimization functions (JS minification, CSS, HTML, resize images for mobile, Webp transformation, asynchronous loading, above the fold and the like) directly to a native module written in C and therefore extremely performing even for sites with high load (tens of thousands of visits per minute).

For example, you could delegate the JS and CSS minification functions to some WordPress plugin like W3 Total Cache or WP Rocket and enable the serving of webp images (which weigh about 50% less as already written in this article ) directly from mod_pagespeed.

Mod_pagesepeed filters, which is what it can do.

A list of available optimizations implemented by Google's PageSpeed ​​Optimization SDK.

PageSpeed ​​modules can automatically optimize web page latency and bandwidth usage by optimizing content to implement web performance best practices.

Reducing the number of requests to a single domain, optimizing cache policies and compressing content can significantly improve web performance and lead to a better user experience.

PageSpeed's optimization filters make it much easier to apply some of these best practices, providing a solution that efficiently and effortlessly speeds up your web applications. Optimization occurs server-side and works regardless of the framework or language used.

 

As you can see, the features are very many and must be enabled based on your theme and site. Not all sites are the same and enabling some incompatible features could "break" the correct functioning of Javascript scripts or CSS elements, producing an incorrect visual effect called pagination or layout pagination.

The ideal philosophy is to enable at least the filters for the images, and gradually enable others as long as you get a good performance result without breaking the correct functioning of the site and the right display.

Can I use it on a shared hosting, a VPS or a Dedicated server?

 

mod_pagespeed or NGX_Pagespeed to work they need to be installed at Apache or NGINX level and therefore the WebServer. It is possible to do this in any context in which the user has access to a Linux instance with root privileges as long as he obviously has excellent system skills since it is an operation performed at the shell level as you see below.

In shared hosting this function is normally not provided because mod_pagespeed and ngx_pagespeed are rather resource-hungry and enabling them in a shared environment would mean for those companies that sell low-cost hosting to see their machines "clogged up" and not be able to proceed with the barbaric practice of overselling (overfilling a server with many customer sites, with a capacity greater than the recommended one) and therefore it is either not enabled or even deliberately disabled.

mod_pagespeed, cPanel and Plesk

Both of the most used hosting control panels in the world provide for the possibility of extending functionality and also the installation of mod_pagespeed as an additional step. The procedure to follow is not so different from what you would do in an environment without a control panel as it must be done from the command line as in the upper screen and in the same way requires root (super user) privileges to be able to download, compile, install and configure the pagespeed module for Apache or NGINX

Considering that at the time by professional systems engineers with over 10 years of experience, our first working installation of ngx_pagespeed (very well calibrated) to solve some small but serious problems of the standard configuration, took about a week, we doubt that an end user a fasting systemistic notions and knowledge of Linux can be able to implement this module alone without risking major damage to the installation or an incorrect configuration of the module that at best can remain inactive, inefficient and at worst break the javascript and the layout of the site.

You can possibly ask your Hosting if it activates and configures mod_pagespeed or ngx_pagespeed on your panel, but don't assume that this can be done easily from your hosting or that it can be done for free, but above all that it can work correctly.

Many of our customers have told us that some hosters have refused the implementation saying that it was not included in their hosting plan and above all that cPanel and Plesk do not have support for pagespeed modules.

 

 

 

Mod_pagespeed and ngx_pagespeed hosting

The best, turnkey solution where you won't have to worry about anything is to rely on a company like ours (not necessarily ours) that offers you a service already included in the high-performance hosting plans and on Dedicated Servers , going to install, configure and calibrate the ngx_pagespeed features on your site, taking care to enable those functions compatible with your site and disable others that could even seriously damage it.

For us, the ngx_pagespeed stack is not just a tangible added value in itself, but a component of a rather advanced and very well configured software stack ( probably the best on the market ) that you can examine in the following graph.

 

 

Using our Hosting means not only having the best performance on the market but also the best management of DDOS attacks and optimal management of security, backup and disaster recovery processes, as well as monitoring and constant assistance 24 hours a day, 365 days a year with very fast intervention times.

Do you have doubts? Don't know where to start? Contact us!

We have all the answers to your questions to help you make the right choice.

Chat with us

Chat directly with our presales support.

0256569681

Contact us by phone during office hours 9:30 - 19:30

Contact us online

Open a request directly in the contact area.

DISCLAIMER, Legal Notes and Copyright. RedHat, Inc. holds the rights to Red Hat®, RHEL®, RedHat Linux®, and CentOS®; AlmaLinux™ is a trademark of the AlmaLinux OS Foundation; Rocky Linux® is a registered trademark of the Rocky Linux Foundation; SUSE® is a registered trademark of SUSE LLC; Canonical Ltd. holds the rights to Ubuntu®; Software in the Public Interest, Inc. holds the rights to Debian®; Linus Torvalds holds the rights to Linux®; FreeBSD® is a registered trademark of The FreeBSD Foundation; NetBSD® is a registered trademark of The NetBSD Foundation; OpenBSD® is a registered trademark of Theo de Raadt; Oracle Corporation holds the rights to Oracle®, MySQL®, MyRocks®, VirtualBox®, and ZFS®; Percona® is a registered trademark of Percona LLC; MariaDB® is a registered trademark of MariaDB Corporation Ab; PostgreSQL® is a registered trademark of PostgreSQL Global Development Group; SQLite® is a registered trademark of Hipp, Wyrick & Company, Inc.; KeyDB® is a registered trademark of EQ Alpha Technology Ltd.; Typesense® is a registered trademark of Typesense Inc.; REDIS® is a registered trademark of Redis Labs Ltd; F5 Networks, Inc. owns the rights to NGINX® and NGINX Plus®; Varnish® is a registered trademark of Varnish Software AB; HAProxy® is a registered trademark of HAProxy Technologies LLC; Traefik® is a registered trademark of Traefik Labs; Envoy® is a registered trademark of CNCF; Adobe Inc. owns the rights to Magento®; PrestaShop® is a registered trademark of PrestaShop SA; OpenCart® is a registered trademark of OpenCart Limited; Automattic Inc. holds the rights to WordPress®, WooCommerce®, and JetPack®; Open Source Matters, Inc. owns the rights to Joomla®; Dries Buytaert owns the rights to Drupal®; Shopify® is a registered trademark of Shopify Inc.; BigCommerce® is a registered trademark of BigCommerce Pty. Ltd.; TYPO3® is a registered trademark of the TYPO3 Association; Ghost® is a registered trademark of the Ghost Foundation; Amazon Web Services, Inc. owns the rights to AWS® and Amazon SES®; Google LLC owns the rights to Google Cloud™, Chrome™, and Google Kubernetes Engine™; Alibaba Cloud® is a registered trademark of Alibaba Group Holding Limited; DigitalOcean® is a registered trademark of DigitalOcean, LLC; Linode® is a registered trademark of Linode, LLC; Vultr® is a registered trademark of The Constant Company, LLC; Akamai® is a registered trademark of Akamai Technologies, Inc.; Fastly® is a registered trademark of Fastly, Inc.; Let's Encrypt® is a registered trademark of the Internet Security Research Group; Microsoft Corporation owns the rights to Microsoft®, Azure®, Windows®, Office®, and Internet Explorer®; Mozilla Foundation owns the rights to Firefox®; Apache® is a registered trademark of The Apache Software Foundation; Apache Tomcat® is a registered trademark of The Apache Software Foundation; PHP® is a registered trademark of the PHP Group; Docker® is a registered trademark of Docker, Inc.; Kubernetes® is a registered trademark of The Linux Foundation; OpenShift® is a registered trademark of Red Hat, Inc.; Podman® is a registered trademark of Red Hat, Inc.; Proxmox® is a registered trademark of Proxmox Server Solutions GmbH; VMware® is a registered trademark of Broadcom Inc.; CloudFlare® is a registered trademark of Cloudflare, Inc.; NETSCOUT® is a registered trademark of NETSCOUT Systems Inc.; ElasticSearch®, LogStash®, and Kibana® are registered trademarks of Elastic NV; Grafana® is a registered trademark of Grafana Labs; Prometheus® is a registered trademark of The Linux Foundation; Zabbix® is a registered trademark of Zabbix LLC; Datadog® is a registered trademark of Datadog, Inc.; Ceph® is a registered trademark of Red Hat, Inc.; MinIO® is a registered trademark of MinIO, Inc.; Mailgun® is a registered trademark of Mailgun Technologies, Inc.; SendGrid® is a registered trademark of Twilio Inc.; Postmark® is a registered trademark of ActiveCampaign, LLC; cPanel®, LLC owns the rights to cPanel®; Plesk® is a registered trademark of Plesk International GmbH; Hetzner® is a registered trademark of Hetzner Online GmbH; OVHcloud® is a registered trademark of OVH Groupe SAS; Terraform® is a registered trademark of HashiCorp, Inc.; Ansible® is a registered trademark of Red Hat, Inc.; cURL® is a registered trademark of Daniel Stenberg; Facebook®, Inc. owns the rights to Facebook®, Messenger® and Instagram®. This site is not affiliated with, sponsored by, or otherwise associated with any of the above-mentioned entities and does not represent any of these entities in any way. All rights to the brands and product names mentioned are the property of their respective copyright holders. All other trademarks mentioned are the property of their respective registrants. MANAGED SERVER® is a European registered trademark of MANAGED SERVER SRL, with registered office in Via Flavio Gioia, 6, 62012 Civitanova Marche (MC), Italy and operational headquarters in Via Enzo Ferrari, 9, 62012 Civitanova Marche (MC), Italy.

JUST A MOMENT !

Have you ever wondered if your hosting sucks?

Find out now if your hosting provider is hurting you with a slow website worthy of 1990! Instant results.

Close the CTA
Back to top