Page 1 of 2

How to Gzip Joomla ?

Posted: Tue Apr 14, 2009 4:07 pm
by viesta
Hi there. I heard that if you gzip your joomla site, it will run faster ? How can i do this ?

Also, i heard that it puts more load on your cpu ? Well that really effect me...because my webhost is BlueHost, and cpu is THIER problem, right ? or will they come after me for slowing down thier cpu?
this is my webhost package....http://www.bluehost.com/tell_me_more.html


another question, how can i cache my site ? that is suppose to make it run faster too right.? and how long should i cache it for

Re: How to Gzip Joomla ?

Posted: Tue Apr 14, 2009 4:16 pm
by Hazzaa
Log in to your Joomla Admin panel, click Global configuration
CPU usage is YOU problem not theirs. They allow you so much load on the server and once you reach the limit your site is shut down for about 1 minute
I have anywhere between 300 and 2,000 users on my site at a time and have no issues. Unless your site has very high volume, I would not worry about GZip. Personally I never cache my site. Any modifications you make take longer to take effect. Again if you are not experiencing high volume, don't worry about

If you are not experiencing high volume but your site IS running slow, then you should look at which extensions you are running on your site and eliminate any troublesome ones

Re: How to Gzip Joomla ?

Posted: Tue Apr 14, 2009 4:18 pm
by ooffick
You can set the GZip setting here:
Global Configuration > Server > Server Settings > GZIP Page Compression

and the cache setting here:
Global Configuration > System > Cache Settings > Cache

Olaf

Re: How to Gzip Joomla ?

Posted: Mon Apr 20, 2009 5:39 am
by roddick
Gzip Joomla has a great built in Gzip function. This will compress your site before it is sent out, making the site load even faster!

Re: How to Gzip Joomla ?

Posted: Mon Apr 20, 2009 8:58 am
by ooffick
You might want to have a look at this post as well, it explains why running Gzip is cheaper and better:

http://paulbuchheit.[URL banned].com/2009/0 ... er-to.html

Olaf

Re: How to Gzip Joomla ?

Posted: Wed Jul 21, 2010 5:46 pm
by Mbit
[quote]You can set the GZip setting here:
Global Configuration > Server > Server Settings > GZIP Page Compression
[quote]

this is just what is needed in order to get the page compressed?
after i searched in the web i saw other ways to enabling gzip
ps adding some lines in htaccess or in the index.php

Re: How to Gzip Joomla ?

Posted: Thu Jul 22, 2010 6:10 pm
by nailson_imgn
Would this feature depend on my server configurations?
Would someone mind to explain to me how can I test it to be sure it is enabled?
How can I know how many load time I'm saving?
Is this something that work the same way in all browsers?
Sorry, If I'm going a little away from the original conversation. I didn't mean to hijack the thread. :-[

Re: How to Gzip Joomla ?

Posted: Thu Jul 22, 2010 6:49 pm
by Mbit
to test if its enabled check here :http://www.whatsmyip.org/http_compression/

Re: How to Gzip Joomla ?

Posted: Thu Jul 22, 2010 7:15 pm
by nailson_imgn
Thanks. This answers almost all I asked :D
The only thing left is: how can I compare the loading time of the normal and GZipped site?
Any clue about it? Thanks in advance.

Re: How to Gzip Joomla ?

Posted: Thu Jul 22, 2010 7:21 pm
by Mbit
there are many sites thats checks speed test... there is also this http://ferenc.biz/yslow-firefox-extension/
firefox addon..

Re: How to Gzip Joomla ?

Posted: Thu Jul 22, 2010 7:51 pm
by nailson_imgn
That won't exactly compare the normal and GZipped modes, will it?
But you've explained a lot already, so thanks. I guess I'll just research a little about that last part. If I ever find such a tool I'll post a link here.
Best regards.

Re: How to Gzip Joomla ?

Posted: Wed Jul 28, 2010 7:47 pm
by azunoman
you are better served, and get more compression by using mod_deflate and turning off Joomla Gzip....servers will compress more data types than joomla...and do it more efficiently.

here is an example (working copy of a large joomla site) for mod_deflate.

<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
DeflateCompressionLevel 1

DeflateFilterNote Input input_info
DeflateFilterNote Output output_info
DeflateFilterNote Ratio ratio_info
LogFormat '"%r" %{output_info}n/%{input_info}n (%{ratio_info}n%%)' deflate
CustomLog /var/log/httpd/deflate_log deflate
</IfModule>

Re: How to Gzip Joomla ?

Posted: Wed Jul 28, 2010 8:10 pm
by nailson_imgn
??? What file do I add that to? How can I check for mod_deflate functionality?

Re: How to Gzip Joomla ?

Posted: Fri Jul 30, 2010 1:49 pm
by azunoman
nailson_imgn wrote:??? What file do I add that to? How can I check for mod_deflate functionality?
this will be of help: http://www.howtoforge.com/apache2_mod_deflate

Re: How to Gzip Joomla ?

Posted: Fri Jul 30, 2010 2:39 pm
by nailson_imgn
Thanks for the useful link.

Re: How to Gzip Joomla ?

Posted: Fri Jul 30, 2010 3:14 pm
by azunoman
I normally do not install the reporting part....why add over head of writing stats that you can get from some performance websites..:) so you could drop the follow:

Code: Select all

DeflateFilterNote Input input_info
DeflateFilterNote Output output_info
DeflateFilterNote Ratio ratio_info
LogFormat '"%r" %{output_info}n/%{input_info}n (%{ratio_info}n%%)' deflate
CustomLog /var/log/httpd/deflate_log deflate
Here is a site you can check you site's compression with: http://www.whatsmyip.org/http_compression/

also, raising the compression level above 1, generally has little affect on the overall compression but does add processor overhead...

Re: How to Gzip Joomla ?

Posted: Tue Oct 05, 2010 7:33 am
by Mbit
although i have enabled gzip from the backend of joomla my template.css is not compressed(reported by page speed/firebug). Is there a line limit ? because template.css has ~2000 lines.
Is there a way to make a specific file compression ?

Re: How to Gzip Joomla ?

Posted: Fri Oct 15, 2010 10:39 am
by Mbit
mod_deflate is disabled in my server! but after i enable Gzip from the backend of joomla there is a kind of compression that starts. Is Joomlas Gzip different than mod_deflate?
should i ask from my host to enable mod_deflate ?

Re: How to Gzip Joomla ?

Posted: Mon Nov 08, 2010 11:52 am
by Mbit
still havent understand how it works.. and if it work correctly. So i have enabled the backend joomla gzip option but.
my mootools.js seems to be not compressed,
http://www.whatsmyip.org/http_compression/ says that gzip is enabled and it saves 5kbs.
PageSpeed firefox plugin says that non css or js in compressed and that if i enabled it i will save 60Kb! :/

Is there a way to compress specific files? Another way to enabled it except from joomla back end?

Re: How to Gzip Joomla ?

Posted: Wed Nov 10, 2010 10:04 pm
by PierreB
How is Cpanel's "optimize website" function (compressing data) related to the "mod_deflate" option, if at all, and how is this setting, if at all, related to the gzip setting?

Concerning the second question, I have a particular case in mind...
...in fact it does not concern Joomla actually, but I thought I would report it.

When I first enabled gzip in phpbb I got an error, saying that gzip was not enabled and I could no longer access the website...I had to change the relevant MySQL value to regain access.
After some time, and having enabled data compression through CPanel, this gzip setting in phpbb worked, so I wondered whether one is the precondition of the other...
From what I read here, it seems that it is not...(I enabled gzip in Joomla only after having enabled compression first in Cpanel, so I don't know how joomla would respond in the absence of the server setting)

Re: How to Gzip Joomla ?

Posted: Thu Nov 11, 2010 8:59 pm
by HTF
Hello,

I enabled mod_deflate and I put the following syntax:

Code: Select all

SetOutputFilter DEFLATE
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ \
    no-gzip dont-vary
SetEnvIfNoCase Request_URI \
    \.(?:exe|t?gz|zip|bz2|sit|rar)$ \
    no-gzip dont-vary
SetEnvIfNoCase Request_URI \.pdf$ no-gzip dont-vary
- I checked the status on http://www.whatsmyip.org/http_compression/ and it looks fine, however when I run YSlow test it says:
Compress components with gzip
There are 17 plain text components that should be sent compressed

* http://domain.com/components/xxx/css/xxx.css
* http://domain.com/components/xxx/css/xxx.css
* http://domain.com/components/xxx/css/xxx.css
* http://domain.com/templates/template/css/xxx.css
* http://domain.com/templates/template/css/xxx.css
* http://domain.com/templates/template/css/xxx.css
* http://domain.com/templates/template/css/xxx.css
* http://domain.com/templates/template/css/xxx.css
* http://domain.com/templates/template/css/xxx.css
* http://domain.com/templates/template/css/xxx.css
* http://domain.com/media/system/js/xxx.js
* http://domain.com/media/system/js/xxx.js
* http://domain.com/components/xxx/js/xxx.js
* http://domain.com/.../xxx.js
* http://domain.com/.../xxx.js
* http://domain.com/.../xxx.js
* http://domain.com/modules/xxx/js/xxx.js
Any ideas?

Re: How to Gzip Joomla ?

Posted: Sun Nov 14, 2010 8:22 pm
by garek007
I just discovered that I can gzip my site.

First question, why is this not the default? Why wouldn't everyone want to gzip their site? Are there issues I should be worried about if I am using gzip?

Also,
When I enable gzip, I still see a lot of spacing when I view the source of a page. Why is that? I thought it was compressed, shouldn't it all be nice and tight?

Re: How to Gzip Joomla ?

Posted: Fri Jan 07, 2011 12:06 am
by agerix
Hi all,

really interresting discuss, thanx for all links and explainations ;)

Re: How to Gzip Joomla ?

Posted: Fri Jan 07, 2011 4:44 am
by keliix06
garek007 wrote:I just discovered that I can gzip my site.

First question, why is this not the default? Why wouldn't everyone want to gzip their site? Are there issues I should be worried about if I am using gzip?

Also,
When I enable gzip, I still see a lot of spacing when I view the source of a page. Why is that? I thought it was compressed, shouldn't it all be nice and tight?
If your server is overloaded, the extra CPU overhead of gzipping the site will slow it down way more than you'd have in any gains of the smaller download size. Running Gzip does require additional CPU time :)

Re: How to Gzip Joomla ?

Posted: Mon Nov 28, 2011 3:31 pm
by naeemdal
If i enable Gzip , will this effect on my server CPU usage? i am using shared hosting,

Re: How to Gzip Joomla ?

Posted: Mon Nov 28, 2011 5:39 pm
by nailson_imgn
Yes, it will. However, it may reduce significantly the amont of data sent with every response. For instance, mooltools.js will drop 46.3KB and query.js wil drop 62.4KB. The more resources a website uses, the better it is to use GZIP or mod_deflate.

Re: How to Gzip Joomla ?

Posted: Fri Dec 16, 2011 10:05 am
by naturapol
I didnt see any advantages of gzip for my website.Benchmark values are same before and after.

Re: How to Gzip Joomla ?

Posted: Fri Dec 16, 2011 3:45 pm
by almooj-craig
As a general rule everything that's not already compressed should be gzipped especially for static files like .js .css .txt.

If you create a .gz of the file using level 9 compression then your server does not need to deflate it each time it's served out because it first checks for the .gz file.
myscript.js
myscript.js.gz
You just need to remember that if you change myscript.js you need to create a new myscript.js.gz file because Apache does not compare dates.

It's also better to use mod_deflate to compress the code that Joomla generates, if you don't have mod_deflate then let php do it using the gzip option in Global Configuration.

What I have been doing for about the last year or so is to store the system-page-cache files as gzipped level 9. Then if the requesting browser can accept gzip I just echo out the file and it's already gzipped, plus it takes up a lot less storage space. The only drawback to that method is that you can not have a security token in the page because you can't use regexp to swap the saved one with the current one, so for example you can't use the log-in module on all of your pages.

Re: How to Gzip Joomla ?

Posted: Sat Dec 17, 2011 10:16 am
by naturapol
almooj-craig wrote:You just need to remember that if you change myscript.js you need to create a new myscript.js.gz file because Apache does not compare dates.
It is a very important detail.Thank you for your warning.

Re: How to Gzip Joomla ?

Posted: Wed Jan 04, 2012 1:33 pm
by almooj-craig
Page Speed works good. While using the Firefox browser install the Firebug and Page Speed add ons. Then clear your cache and load the page you want to check. Press F12 and select Page Speed. You could then Analyze the Performance or check the Resources.