Output compression - what does 'gzip' in CMS do?
Moderator: General Support Moderators
Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
- jjonker
- Joomla! Intern
- Posts: 54
- Joined: Sat May 27, 2006 10:18 pm
- Contact:
Output compression - what does 'gzip' in CMS do?
Hi!
I am a bit confused about the compression / gzip of output files. Maybe someone can enlighten me...
When I turn on the option in the CMS server settings tot enable gzip compression, what does the CMS actually do?
I think it uses PHP output buffering (with ob_gzhandler function?) to compress data send to the browser. Right. But does this function use apache mod_deflate? Or mod_gzip? Or neither?
Is I leave this option off and my site ARE compressed (you can use online gzip compression check tools to check this, like https://checkgzipcompression.com) where does the compression come from? I check the .htaccess of a site, but that does not contain any code to trigger mod_deflate or mod_gzip. Or is there maybe a serverwide setting to enable and use mod_deflate?
Is mod_deflate is present on the server, does it by default compress the output? Or does it need to be activated/triggered by lines in the .htaccess?
If mod_deflate is used on the server (by default) and we also enable gzip in the CMS, will this cause issues because different types of compressions are used? Or maybe compression is added twice / layered?
Any insights and tips/suggestions on how to use compression are welcome! Thanks.
I am a bit confused about the compression / gzip of output files. Maybe someone can enlighten me...
When I turn on the option in the CMS server settings tot enable gzip compression, what does the CMS actually do?
I think it uses PHP output buffering (with ob_gzhandler function?) to compress data send to the browser. Right. But does this function use apache mod_deflate? Or mod_gzip? Or neither?
Is I leave this option off and my site ARE compressed (you can use online gzip compression check tools to check this, like https://checkgzipcompression.com) where does the compression come from? I check the .htaccess of a site, but that does not contain any code to trigger mod_deflate or mod_gzip. Or is there maybe a serverwide setting to enable and use mod_deflate?
Is mod_deflate is present on the server, does it by default compress the output? Or does it need to be activated/triggered by lines in the .htaccess?
If mod_deflate is used on the server (by default) and we also enable gzip in the CMS, will this cause issues because different types of compressions are used? Or maybe compression is added twice / layered?
Any insights and tips/suggestions on how to use compression are welcome! Thanks.
- jjonker
- Joomla! Intern
- Posts: 54
- Joined: Sat May 27, 2006 10:18 pm
- Contact:
Re: Output compression - what does 'gzip' in CMS do?
After some more reading I found that the PHP function 'ob_gzhandler' uses zlib output_compression. I think (correct me if I'm wrong) this has not relation to apache mod_deflate. But I am not sure what the PHP zlib output_compression actually does. What does it compress in Joomla? And when is it decompressed?
Or am I totally wrong here? ;-)
If Joomla uses zlib output_compression (using the option Gzip page compression) would that in anyway conflict with having mod_deflate enabled as well?
We have a site that gives us some errors when both are used. For example downloads that appear on screen as scrambled text. Also some compression errors from the browser. I think maybe this has to do with double compression? (PHP and Apache) Is this possible?
Or am I totally wrong here? ;-)
If Joomla uses zlib output_compression (using the option Gzip page compression) would that in anyway conflict with having mod_deflate enabled as well?
We have a site that gives us some errors when both are used. For example downloads that appear on screen as scrambled text. Also some compression errors from the browser. I think maybe this has to do with double compression? (PHP and Apache) Is this possible?
-
- I've been banned!
- Posts: 13639
- Joined: Sun Jul 05, 2009 3:30 am
- Location: Canberra, Australia
Re: Output compression - what does 'gzip' in CMS do?
The documentation states
If set to “Yes”, the web server will compress the content sent out from your Joomla site. This will speed-up page load times, especially for web site users who have a low-bandwidth connection. The default setting is “No”.
- jjonker
- Joomla! Intern
- Posts: 54
- Joined: Sat May 27, 2006 10:18 pm
- Contact:
Re: Output compression - what does 'gzip' in CMS do?
Hi Sozzled, Yes I read that ;-) But I would like to know more about how this process words and/or what PHP functions / apache modules are used to achieve this. I can not fin d any info on this.
I found a lot of internet pages telling users to turn it off if they have compressions issues. But I can't seem to find out why and how...
What I would like to figure out is if the CMS Gzip functions can cause issues with mod_deflate. We have encountered some issues and decided to disable the CMS Gzip compression on all sites on our server (that has mod_deflate enabled).
But maybe these issues were a bug? I am not sure how these compression methods compare / interact / conflict with eachother.
I found a lot of internet pages telling users to turn it off if they have compressions issues. But I can't seem to find out why and how...
What I would like to figure out is if the CMS Gzip functions can cause issues with mod_deflate. We have encountered some issues and decided to disable the CMS Gzip compression on all sites on our server (that has mod_deflate enabled).
But maybe these issues were a bug? I am not sure how these compression methods compare / interact / conflict with eachother.
-
- I've been banned!
- Posts: 13639
- Joined: Sun Jul 05, 2009 3:30 am
- Location: Canberra, Australia
Re: Output compression - what does 'gzip' in CMS do?
I can only tell you what I know. There's a setting in the Joomla Global Configuration. You can find more by using Google to understand the purpose of GZIP compression.
I use it myself. I have no problems with it. I don't need to know a lot more about "how it works"; the simple fact is that it works and it gives me a modest improvement in page load speeds. That's really all I need to know.
I use it myself. I have no problems with it. I don't need to know a lot more about "how it works"; the simple fact is that it works and it gives me a modest improvement in page load speeds. That's really all I need to know.
-
- Joomla! Apprentice
- Posts: 15
- Joined: Sat Dec 30, 2017 5:51 pm
Re: Output compression - what does 'gzip' in CMS do?
I have a somewhat related question (where it would help a lot to know more how this gzip option in joomla works really):
I just enables brotli compression in the apache webserver. This is an alternative compression that is more efficient as well as faster than gzip for typical web content. So it is preferred over gzip.
However I see that the joomla pages that my browser fetches are gzip compressed. The browser indicates that it would accept gzip, brotli and deflate. The server delivers gzip compressed content.
Does that have something to do with the gzip option? So would it be better to disable it and then the webserver does the compression? What are the advantages / disadvantages in having the webserver do the compression on the fly? What is more effective?
I just enables brotli compression in the apache webserver. This is an alternative compression that is more efficient as well as faster than gzip for typical web content. So it is preferred over gzip.
However I see that the joomla pages that my browser fetches are gzip compressed. The browser indicates that it would accept gzip, brotli and deflate. The server delivers gzip compressed content.
Does that have something to do with the gzip option? So would it be better to disable it and then the webserver does the compression? What are the advantages / disadvantages in having the webserver do the compression on the fly? What is more effective?
-
- Joomla! Apprentice
- Posts: 38
- Joined: Thu Apr 05, 2018 12:43 pm
- Contact:
Re: Output compression - what does 'gzip' in CMS do?
I use GZIP in my wordpress site and it basically speeds up delivery of content to site visitors. Is this an option for Joomla? I'm thinking of switching if there are performance benefits.
- jjonker
- Joomla! Intern
- Posts: 54
- Joined: Sat May 27, 2006 10:18 pm
- Contact:
Re: Output compression - what does 'gzip' in CMS do?
On our server there is compression enabled on the server level. So I disabled this option in Joomla, because using double compression (two methods) is probably not a very good idea...
Switching to Joomla is always smart ;-)
Switching to Joomla is always smart ;-)