Home > Help Center > Shared Hosting > Control Panel > PageSpeed Module in cPanel

PageSpeed Module in cPanel

What is mod_pagespeed?

mod_pagespeed is an Open Source Apache module created by Google that rewrites the webpage code to reduce the latency(delay) and bandwidth (resource volume) and ultimately reduce the load time for that page in the browser.

mod_pagespeed is a collection of more than 40 filters that scan and optimize different parts of the webpage's code such as:

  • Combining and minimizing HTML, JavaScript and CSS files
  • Serving inlined, low-quality placeholder images until originals are loaded.
  • Dynamic image optimization,
  • Removing unused metadata from each file
  • Resizing and compressing images

How do mod_pagespeed filters work?

The complete list of mod_pagespeed filters as well as sample tests can be found at the following URL: www.modpagespeed.com:

apache page speed

Each filter has an HTML example attached - click on before link to see the original file and after link to see what PageSpeed changes using this only filter.

Both versions look exactly the same in a browser, but after will be a bit faster. Changes to the code can be seen by right-clicking on the page and selecting from the menu: Page Source or by typing Ctrl+U on the keyboard.

Let's look at how the remove_comments filter works.

The remove_comments filter removes HTML comments that are often used by developers to add clarifications to the code without displaying them in the browser.

For example, if the HTML document looks like this:

<html>
<body>
<!-- Display the site logo here -->
<img src="logo.png">
<!-- Now show the page contents -->
<div>Some content here</div>
<!-- Apply IE-specific CSS -->
<!-- [if IE ]>
<link href="iecss.css" rel="stylesheet" type="text/css">
<![endif]-->
<!-- google_ad_section_end  -- retained due to RetainComment directive -->
</body>
</html>

PageSpeed will modify it into this:

<html>
<body>
<img src="logo.png">
<div>Some content here</div>
<!-- [if IE ]>
<link href="iecss.css" rel="stylesheet" type="text/css">
<![endif]-->
<!-- google_ad_section_end  -- retained due to RetainComment directive -->
</body>
</html>

You can enable the PageSpeed module in cPanel by following the steps outlined below.

Open the cPanel homepage, go to the Domains section and click the PageSpeed link:

apache page speed

On the next screen you will see a list of all domains and subdomains in your hosting account.

By default, PageSpeed is disabled for all domains in the account:

apache page speed

You can enable PageSpeed for a particular domain by clicking the Enable button next to the domain name.

A confirmation message will inform you that the activation is successful:

apache page speed

The status parameter Enabled will change its color to green and the text of the button will change to Disable:

apache page speed

Now let's check the effect from activating PageSpeed on our site.

We've run a few tests with different web pages in advance and it seems that the results from PageSpeed Insights gave us a little more accurate information than the other online tools.

Once you've loaded the test page, enter the URL of your website and click the Analyze button to start the scan:

apache page speed

In fact, we did two tests with the same webpage from a WordPress site to check if there is a difference in the speed of the page depending on the status of the PageSpeed module.

When PageSpeed is Disabled:

apache page speed

When PageSpeed is Enabled:

apache page speed

Apparently, for this site, activating PageSpeed gave a very good result.

We strongly recommend that you try out all the basic features of your website before deciding whether to leave the PageSpeed enabled.

To disable PageSpeed, click the Disable button. A new message will confirm that deactivation is successful:

apache page speed

Keep in mind that all online optimization tools offer optimization solutions that only relate to the site loading speed.

Website loading speed is an important ranking factor, but the overall success of a website is a result of the collaboration of many different components, so do not consider the test results out of the green zone as something critical even less fatal.

In short: in cPanel you have another useful tool to optimize the web page load speed which tool we recommend you to test.

Still not finding what you're looking for?

Contact our support team with any additional questions or concerns.

Contact support