Table of contents of the article:
If until 2019 we were enthusiastically using mod_pagespeed for Apache and the respective ngx_pagespeed for NGINX in some cases and even felt like recommending it as we did in this article mod_pagespeed and ngx_pagespeed. Google Modules for Apache Web Server and NGINX to improve performance. , today more than ever the time has come to announce to the world that since 2020 at least it no longer makes sense to use a project now abandoned, dead and buried.
But let's go back briefly to the previously discussed topic by explaining, albeit this time in a more approximate way, what mod_pagespeed is and what were the initial objectives desired by Google itself.
What is mod_pagespeed?
mod_pagespeed is an Apache module created by Google to improve web page performance. The module uses various techniques to optimize page content, such as image compression and CSS and JavaScript minification, to reduce page load times.
Google created mod_pagespeed to help webmasters improve the speed of their web pages. Page loading speed is an important factor in user experience and search engine rankings.
mod_pagespeed was first launched in 2010 as an open source project and has received numerous features over the years. For example, it can optimize images to reduce their weight without compromising quality, automatically generate responsive images to optimize viewing on mobile devices, and minify CSS and JavaScript code to reduce the amount of data to download .
In 2018, Google announced that it would discontinue active development of mod_pagespeed, but continued to provide support for the existing version until 2021. After that, the project was officially abandoned, and no further support or updates are available from Google.
What is ngx_pagespeed ?
ngx_pagespeed is a port of mod_pagespeed for the NGINX web server. This is a module that allows system administrators to use the same performance optimization features as mod_pagespeed on an NGINX server.
The ngx_pagespeed project was created by a group of independent developers who wanted to port the mod_pagespeed functionality to a web server other than Apache. The ngx_pagespeed module was first released in 2012 and has consistently received updates and new features over the years.
Like mod_pagespeed, ngx_pagespeed uses virtually the same techniques to optimize web page performance, such as image compression, minification of CSS and JavaScript, and optimization of browser requests. In addition, ngx_pagespeed allows system administrators to granularly configure optimizations to be applied to web pages, allowing them to tailor performance to the specific needs of their website.
Although ngx_pagespeed was created by independent developers, it received support from Google until 2018 , when Google announced that it had discontinued active development of mod_pagespeed. After that, ngx_pagespeed was also discontinued, and no official updates or support are available.
Where is mod_pagespeed still used?
Many control panels like Plesk or cPanel offer mod_pagespeed as a feature to improve the speed and pagespeed score of websites. These control panels allow system administrators to easily activate and configure mod_pagespeed to optimize the performance of their web pages.
In Plesk, mod_pagespeed is available as an add-on, or rather, an extension, that can be easily installed and configured by the server administrator. Once installed, Plesk provides a graphical interface for configuring mod_pagespeed settings, such as image compression, CSS and JavaScript minification, and browser request optimization.
cPanel also offers mod_pagespeed as a server performance optimization option. Like Plesk, mod_pagespeed can be easily enabled and configured by the server administrator. cPanel also offers a graphical interface for configuring mod_pagespeed settings and viewing the results of performance optimizations.
Even though mod_pagespeed is no longer actively developed by Google, Plesk control panels and cPanel continue to use it as a feature to improve the speed and pagespeed score of websites. However, being an abandoned project, there are no more updates or official support available for these tools.
Why still use mod_pagespeed or ngx_pagespeed ?
Information technology is a rapidly evolving field, and what is considered correct today may not be tomorrow. Technology and the way users interact with it are constantly changing, and developers and system administrators must be able to adapt to these changes to ensure their websites always perform well and meet user needs.
Often when doing searches on the net to optimize a website, one comes across old posts, articles and guides that refer to a very specific period, the reader is not able to understand the context of what he reads and mistakenly thinks that that optimization guide that recommends mod_pagespeed is still in vogue and therefore they lend themselves to following obsolete tutorials that not only do not bring benefits in terms of performance, but are even harmful.
Google, as a leader in the search engine industry, has developed various metrics and scores over the years to evaluate the quality and performance of websites. For example, Google introduced the Google Core Web Vitals , a set of metrics that evaluate the speed, interactivity, and visual stability of web pages, and the PageSpeed Insight score, which evaluates the speed and performance of web pages on mobile and desktop devices.
These changes in website quality metrics have had a significant impact on the mod_pagespeed tool created by Google. Initially designed to improve web page performance using various optimization techniques, mod_pagespeed quickly became obsolete due to the evolution of Google's evaluation metrics. In some cases, using mod_pagespeed can even have a negative impact on web page performance, as the optimizations applied by the tool may no longer be in line with current Google guidelines.
mod_pagespeed and Time To First Byte.
Time to First Byte (TTFB) is a metric that measures the time between a browser requesting a web page and receiving the first byte of data from the server. It is considered an indicator of server speed and network latency. A high TTFB indicates a slow server or network connection, while a low TTFB indicates a fast server and network connection.
TTFB is one of the important parameters in Google Core Web Vitals , a set of metrics introduced by Google to evaluate the speed, interactivity, and visual stability of web pages. These metrics are important because Google uses this information to evaluate the quality of websites and determine their ranking in search results. A high TTFB can negatively impact user experience and a website's visibility in search engines.
Google itself strongly recommends a TTFB of 200 milliseconds maximum, obviously an optimal value is certainly less than 100 milliseconds and as we will see, mod_pagespeed does not help to lower the TTFB as many still believe.
Someone on the net had already noticed the problem and had also opened discussions on GitHub, but at that time the focus was almost exclusively on Pagespeed scores with very questionable metrics and which did not take into account the importance of TTFB.
You can follow the original post (of which I report the screenshot below) at this link: https://github.com/apache/incubator-pagespeed-mod/issues/1293
Another warning appeared in a StackOverflow thread that bluntly mentioned that mod_pagespeed was increasing TTFB. You can read the original, albeit inconclusive, thread at this link: https://stackoverflow.com/questions/24099190/google-nginx-pagespeed-with-varnish-increases-ttfb
It's certainly not easy to understand that although mod_pagespeed is an Apache module designed to improve web page performance using various optimization techniques, it can increase a web page's Time To First Byte (TTFB) due to the latency introduced by its optimization operations. It performs optimization operations such as image compression, CSS and JavaScript minification, and browser request optimization. These operations take time to execute, which can increase TTFB.
Furthermore, mod_pagespeed uses a caching algorithm to cache optimized web pages and reduce the latency of subsequent requests. However, if the caching algorithm is not configured correctly, it can cause TTFB to increase because the server must first fetch the web page from the cache before sending it to the browser.
A real world example of how mod_pagespeed slows down a WordPress site.
For example, let's take a look at a site like lavocedeltrentino.it, a well-known newspaper that thought it could solve the performance problems of their site by switching from our hosting to that of another improvised provider which caused a performance degradation of this standard.
After some time, the site from a raw Apache on Plesk, they thought it was appropriate to add mod_pagespeed as a value-added technology to improve the speed of the site, and indeed the improvement was there if we consider that anyway mod_pagespeed has a all the effects of an internal Full Page Cache which in cases of extreme slowness can also significantly improve performance as we can see from the screen below, reaching just over three seconds, with an initial unfortunate situation of about double.
If we look at curl's response in detail, we can see how it uses mod_pagespeed on Plesk and that from a Fastweb connection on mixed copper fiber it has a TTFB of 1,38 seconds, while in the next screenshot testing a site that uses their exact same theme (Zox News) like corrieredellacitta.com the TTFB is just 0,2 seconds or about 7 times faster.
If we also examine the TTFB measured at European level by SpeedVitals , we see in even more detail how mod_pagespeed really sucks in terms of performance, embarrassingly increasing the TTFB with scores all marked in red, unlike those of ilcorrieredellacitta.com which are normal.
What to do if you are using mod_pagespeed and how to replace it?
If you are using mod_pagespeed or ngx_pagespeed, it is highly recommended to remove the extension urgently. These modules, although initially designed to improve the performance of web pages, can cause performance problems due to their obsolescence and new Google guidelines.
The main reason to remove these extensions is that many of the optimization operations performed by mod_pagespeed or ngx_pagespeed can be performed more effectively and in a more granular way at the application level, for example through the use of dedicated plugins such as W3 Total Cache, Autoptimize, Wp Rocket or combinations of these tools if we are dealing with a WordPress installation.
For example, JS optimization, minification, compression, critical css, unused code removal and webp image delivery can be done in a more precise and customizable way through the use of these plugins.
Removing mod_pagespeed or ngx_pagespeed from your server, and using these plugins to optimize web page performance, will allow you to adapt to current Google guidelines and gain more precise and granular control over optimizing the performance of your web pages.