How to Gzip Joomla ?

Discussion regarding Joomla! 1.5 Performance issues.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Security and Performance FAQs
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
viesta
Joomla! Intern
Joomla! Intern
Posts: 66
Joined: Sat Mar 21, 2009 7:12 am

How to Gzip Joomla ?

Post by viesta » Tue Apr 14, 2009 4:07 pm

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

User avatar
Hazzaa
Joomla! Explorer
Joomla! Explorer
Posts: 342
Joined: Fri Nov 24, 2006 6:13 pm

Re: How to Gzip Joomla ?

Post by Hazzaa » Tue Apr 14, 2009 4:16 pm

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

User avatar
ooffick
Joomla! Master
Joomla! Master
Posts: 11614
Joined: Thu Jul 17, 2008 3:10 pm
Location: Ireland
Contact:

Re: How to Gzip Joomla ?

Post by ooffick » Tue Apr 14, 2009 4:18 pm

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
Olaf Offick - Global Moderator
learnskills.org

roddick
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Sun Apr 19, 2009 2:49 pm

Re: How to Gzip Joomla ?

Post by roddick » Mon Apr 20, 2009 5:39 am

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!
http://www.joomlarevolution.org/ Joomla Video Tutorials
Signature rules - Literal URL's only

User avatar
ooffick
Joomla! Master
Joomla! Master
Posts: 11614
Joined: Thu Jul 17, 2008 3:10 pm
Location: Ireland
Contact:

Re: How to Gzip Joomla ?

Post by ooffick » Mon Apr 20, 2009 8:58 am

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
Olaf Offick - Global Moderator
learnskills.org

Mbit
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 126
Joined: Wed Mar 17, 2010 7:46 am

Re: How to Gzip Joomla ?

Post by Mbit » Wed Jul 21, 2010 5:46 pm

[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
Buy Medical Supplies, Medical Equipment and Home Health Care products: http://www.medi-shop.gr/en

User avatar
nailson_imgn
Joomla! Guru
Joomla! Guru
Posts: 729
Joined: Wed Apr 15, 2009 5:33 pm
Location: Fortaleza, CE - Brasil

Re: How to Gzip Joomla ?

Post by nailson_imgn » Thu Jul 22, 2010 6:10 pm

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. :-[
.
Nailson Oliveira
Técnico de Tecnologia da Informação - Desenvolvedor Joomla!
-----------------------------------------------------------------------------------------

Mbit
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 126
Joined: Wed Mar 17, 2010 7:46 am

Re: How to Gzip Joomla ?

Post by Mbit » Thu Jul 22, 2010 6:49 pm

to test if its enabled check here :http://www.whatsmyip.org/http_compression/
Buy Medical Supplies, Medical Equipment and Home Health Care products: http://www.medi-shop.gr/en

User avatar
nailson_imgn
Joomla! Guru
Joomla! Guru
Posts: 729
Joined: Wed Apr 15, 2009 5:33 pm
Location: Fortaleza, CE - Brasil

Re: How to Gzip Joomla ?

Post by nailson_imgn » Thu Jul 22, 2010 7:15 pm

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.
.
Nailson Oliveira
Técnico de Tecnologia da Informação - Desenvolvedor Joomla!
-----------------------------------------------------------------------------------------

Mbit
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 126
Joined: Wed Mar 17, 2010 7:46 am

Re: How to Gzip Joomla ?

Post by Mbit » Thu Jul 22, 2010 7:21 pm

there are many sites thats checks speed test... there is also this http://ferenc.biz/yslow-firefox-extension/
firefox addon..
Buy Medical Supplies, Medical Equipment and Home Health Care products: http://www.medi-shop.gr/en

User avatar
nailson_imgn
Joomla! Guru
Joomla! Guru
Posts: 729
Joined: Wed Apr 15, 2009 5:33 pm
Location: Fortaleza, CE - Brasil

Re: How to Gzip Joomla ?

Post by nailson_imgn » Thu Jul 22, 2010 7:51 pm

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.
.
Nailson Oliveira
Técnico de Tecnologia da Informação - Desenvolvedor Joomla!
-----------------------------------------------------------------------------------------

azunoman
Joomla! Explorer
Joomla! Explorer
Posts: 413
Joined: Sat Oct 10, 2009 2:28 pm
Location: Medellin, Colombia

Re: How to Gzip Joomla ?

Post by azunoman » Wed Jul 28, 2010 7:47 pm

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>
Retired IBM 360/370 Assembler TPF Systems Programmer

User avatar
nailson_imgn
Joomla! Guru
Joomla! Guru
Posts: 729
Joined: Wed Apr 15, 2009 5:33 pm
Location: Fortaleza, CE - Brasil

Re: How to Gzip Joomla ?

Post by nailson_imgn » Wed Jul 28, 2010 8:10 pm

??? What file do I add that to? How can I check for mod_deflate functionality?
.
Nailson Oliveira
Técnico de Tecnologia da Informação - Desenvolvedor Joomla!
-----------------------------------------------------------------------------------------

azunoman
Joomla! Explorer
Joomla! Explorer
Posts: 413
Joined: Sat Oct 10, 2009 2:28 pm
Location: Medellin, Colombia

Re: How to Gzip Joomla ?

Post by azunoman » Fri Jul 30, 2010 1:49 pm

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
Retired IBM 360/370 Assembler TPF Systems Programmer

User avatar
nailson_imgn
Joomla! Guru
Joomla! Guru
Posts: 729
Joined: Wed Apr 15, 2009 5:33 pm
Location: Fortaleza, CE - Brasil

Re: How to Gzip Joomla ?

Post by nailson_imgn » Fri Jul 30, 2010 2:39 pm

Thanks for the useful link.
.
Nailson Oliveira
Técnico de Tecnologia da Informação - Desenvolvedor Joomla!
-----------------------------------------------------------------------------------------

azunoman
Joomla! Explorer
Joomla! Explorer
Posts: 413
Joined: Sat Oct 10, 2009 2:28 pm
Location: Medellin, Colombia

Re: How to Gzip Joomla ?

Post by azunoman » Fri Jul 30, 2010 3:14 pm

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...
Retired IBM 360/370 Assembler TPF Systems Programmer

Mbit
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 126
Joined: Wed Mar 17, 2010 7:46 am

Re: How to Gzip Joomla ?

Post by Mbit » Tue Oct 05, 2010 7:33 am

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 ?
Buy Medical Supplies, Medical Equipment and Home Health Care products: http://www.medi-shop.gr/en

Mbit
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 126
Joined: Wed Mar 17, 2010 7:46 am

Re: How to Gzip Joomla ?

Post by Mbit » Fri Oct 15, 2010 10:39 am

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 ?
Buy Medical Supplies, Medical Equipment and Home Health Care products: http://www.medi-shop.gr/en

Mbit
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 126
Joined: Wed Mar 17, 2010 7:46 am

Re: How to Gzip Joomla ?

Post by Mbit » Mon Nov 08, 2010 11:52 am

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?
Buy Medical Supplies, Medical Equipment and Home Health Care products: http://www.medi-shop.gr/en

PierreB
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 152
Joined: Tue Sep 21, 2010 2:39 pm

Re: How to Gzip Joomla ?

Post by PierreB » Wed Nov 10, 2010 10:04 pm

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)

HTF
Joomla! Apprentice
Joomla! Apprentice
Posts: 36
Joined: Sun Jan 31, 2010 11:59 am

Re: How to Gzip Joomla ?

Post by HTF » Thu Nov 11, 2010 8:59 pm

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?

garek007
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 111
Joined: Mon Jun 22, 2009 8:05 pm

Re: How to Gzip Joomla ?

Post by garek007 » Sun Nov 14, 2010 8:22 pm

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?

User avatar
agerix
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Wed Mar 24, 2010 2:13 pm
Location: Bordeaux
Contact:

Re: How to Gzip Joomla ?

Post by agerix » Fri Jan 07, 2011 12:06 am

Hi all,

really interresting discuss, thanx for all links and explainations ;)
adishatz, erix
https://www.agerix.fr

User avatar
keliix06
Joomla! Ace
Joomla! Ace
Posts: 1022
Joined: Wed Aug 17, 2005 11:46 pm
Location: Minneapolis, MN
Contact:

Re: How to Gzip Joomla ?

Post by keliix06 » Fri Jan 07, 2011 4:44 am

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 :)
Doyle Lewis
BuyHTTP Internet Services
http://www.buyhttp.com/joomla_hosting.html - No Overselling Guarantee. Your Joomla site, faster.
http://www.joomlademo.com - 30 day free trial of Joomla

naeemdal
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 138
Joined: Tue Nov 16, 2010 1:45 pm
Location: hyderabad
Contact:

Re: How to Gzip Joomla ?

Post by naeemdal » Mon Nov 28, 2011 3:31 pm

If i enable Gzip , will this effect on my server CPU usage? i am using shared hosting,
Regards

User avatar
nailson_imgn
Joomla! Guru
Joomla! Guru
Posts: 729
Joined: Wed Apr 15, 2009 5:33 pm
Location: Fortaleza, CE - Brasil

Re: How to Gzip Joomla ?

Post by nailson_imgn » Mon Nov 28, 2011 5:39 pm

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.
.
Nailson Oliveira
Técnico de Tecnologia da Informação - Desenvolvedor Joomla!
-----------------------------------------------------------------------------------------

naturapol
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Tue Dec 13, 2011 2:58 am
Location: Turkiye
Contact:

Re: How to Gzip Joomla ?

Post by naturapol » Fri Dec 16, 2011 10:05 am

I didnt see any advantages of gzip for my website.Benchmark values are same before and after.

almooj-craig
Joomla! Guru
Joomla! Guru
Posts: 500
Joined: Mon Aug 11, 2008 3:05 pm

Re: How to Gzip Joomla ?

Post by almooj-craig » Fri Dec 16, 2011 3:45 pm

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.

naturapol
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Tue Dec 13, 2011 2:58 am
Location: Turkiye
Contact:

Re: How to Gzip Joomla ?

Post by naturapol » Sat Dec 17, 2011 10:16 am

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.

almooj-craig
Joomla! Guru
Joomla! Guru
Posts: 500
Joined: Mon Aug 11, 2008 3:05 pm

Re: How to Gzip Joomla ?

Post by almooj-craig » Wed Jan 04, 2012 1:33 pm

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.


Locked

Return to “Performance - Joomla! 1.5”