The answers to all your questions about Joomla Gzip compression.
When you are a web developer, having a solid foundation about the web would get you to places. You will be able to create powerful websites that novice developers can’t. This is the single most essential thing that will distinguish you from the amateurs. Therefore, let’s learn something fundamental today. What is Gzip, why should we use Gzip compression, how Gzip helps websites, and how to use Gzip on Joomla websites.
What is Gzip Compression?
The size of a webpage is what weight is to a physical object. We measure physical objects like bag/basket in Kg/lbs and vertical objects (web pages) in KB/MB. In the physical world, the more the size becomes the more energy it requires to move the object. Similarly, the more KB/MB of your web page becomes, the more (time) it takes to load a web page on the browser.
Gzip compression is brilliantly simple and extremely powerful.
To put it in layman’s term, if you were going to lift a bag of 10 Kg, you’ll be needing a lot less energy when you are lifting a bag of 1 kg. That’s what Gzip compression is. It reduces the size (weight) of the web pages without decreasing the content quality.
Why Use Gzip Compression?
Since it’s established that the size of a web page determines how long it is going to take to load that page, we can go ahead and discuss how to reduce the size. This is where content-encoding comes into the picture. When as a user, you type something like google.com in the address bar of your browser and hit enter, the browser sends a request for the file http://www.google.com/index.html. Your browser then talks to the webserver. This is how it goes -
- Browser: Hey, can you give me the /index.html
- Server: Ok, let me see if index.html is around
- Server: Found it! Here, I’m sending the response code and the file
- Browser: 300KB? Crap... waiting, waiting… Ok, it’s loaded now
So you see, this is why we should use Gzip compression. When you use Gzip compression on your Joomla website. It improves the performance and reduces the loading time dramatically. Say a 300KB web page can become 100KB if compressed. When a request is made for your website by a visitor, the server compresses the requested page and reduces its size significantly. And then sends it to the user’s computer. It’s the browser that does the decompressing and visualization in an extremely fast and unnoticeable way.
The time and resource spent on compressing/decompressing a webpage are significantly less than loading a large file.
The algorithm of Gzip is brilliantly simple. It locates similar strings and replaces them temporarily. The reason it works like a charm when applied to web pages is, HTML/CSS files use a lot of repeated text. As Gzip compresses the common strings, it reduces the file size up to 70%.
How to Enable Gzip Compression in Joomla?
Since Joomla is an open-source CMS - built for the developers, by the developers. We are blessed to have powerful features already built in the system. To enable Gzip for your Joomla website go to the backend of your site.
Joomla backend > System > Global Configuration.
Then browse to the Server (tab) > Server Settings > Gzip Page Compression > and set the toggle to Yes.
How to Check If Gzip Is Properly Enabled?
When you have configured your site, how do you tell if the compression is working properly? Well, you don't have to worry. There are plenty of tools available online to check that for you. Here's one of the sites I frequently use to check if my website is properly Gzip enabled.
It is strongly advised that you use Gzip on your Joomla website. It helps to boost your website performance significantly. Which results in better user experience, better traffic and overall a better impression. Oh, did you know search engines care for the websites that have lighting loading speed? Yeap, that’s right! Enabling Gzip compression on your Joomla website even helps to rank better on Google.
What would you like to know next? Put your thoughts in the comments below and let us indulge your curiosity.
I would like to know about caching, how it affects an actual production website.
Having more items cache reduce speed?
In an example, a e-commerce platform builds a cache, and let's say I clear the cache how does this affect my customers, and their shopping carts, etc.
Thanks
[img]https://www.joomshaper.com/images/2020/01/09/not_covered_page2.png[/img][b]Save/Open in new tab for an enlarged view[/b]
In the above image, you'll see only one file that is coming from google server, It is not going to be compressed.
If you navigate to [Speed -> Optimisation -> Brotli Compression] it will take off some load from your servers by applying "gzip compression" via Cloudflare if it can't use Brotli encoding:
More details:
https://support.cloudflare.com/hc/en-us/articles/200168396
Another interesting article would be, how to tweak a joomla site to raise the google page speed index. Because after the test there are often stated to reduce picture sizes, use mordern picture formats, get rid of rendering blockings.
But often it is hard to solve all these "suggestions" with joomla and sp page builder.
Some help from your site will be appreciated.
With kind regards
René
Also, make sure SCSS isn't set to compile on live-mode in the template settings and production mode is turned on within the SP Page Builder options.
That'll let JCH Optimise work a lot better and reduce response times to the ~100ms mark..
Of course, i will refer the original artiicle, author and link it