Speed up Magento by ~235%
How to REALLY speed up your Magento site:
The information below on enabling gzip compression will improve your speed a bit, but if you are using a bargain basement web host then that could be a major factor as well. XPC Web Hosting provides advanced technology for speeding up your sites with performance tuned servers in both the USA and Canada. Some of our latest improvements include nginx which speeds up image loading and our database backup system that creates two backups a day and stores off-site archives for 30 days in case of emergency. Learn more.
GZip Compression:
There’s a feature called “gzip” that’s installed by default on most web servers. Modifying your site to make use of it can really speed up the performance.
How much faster?
Try the quick and easy mod_gzip tester by WhatsMyIP.org. Just enter the URL and it will tell you how much faster it would be.
How to enable it for Magento
“One of the drawbacks of Magento is currently its speed if default configuration is used. There are certain ways of making it run faster. The best one is to enable GZip compression by changing .htaccess file a little. You just need to uncomment part of the code. In my case, the speed increase was exactly 235%.
Find the following lines in your Magento .htaccess file and replace them with the following code.
(You just have to uncomment the lines so it looks like the following)
## enable apache served files compression
## http://developer.yahoo.com/performance/rules.html#gzip
# Insert filter
SetOutputFilter DEFLATE
# Netscape 4.x has some problems…
BrowserMatch ^Mozilla/4 gzip-only-text/html
# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4\.0[678] no-gzip
# MSIE masquerades as Netscape, but it is fine
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
# Don’t compress images
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
# Make sure proxies don’t deliver the wrong content
Header append Vary User-Agent env=!dont-vary
“
Source: inchoo.net
UPDATE: You need to uncomment the following as well:
## enable resulting html compression
php_flag zlib.output_compression on
Thanks to Reno for pointing this out! It made a huge difference for me!

Thanks for pointing that out – simple yet effective
Hey man. Thanks for putting the referrer source. I’m glad it helped you.
made little difference to us, thanks anyway.
Hello there,
this work for me, but i cant tell you the % of increase..
but its faster!!!
Thanks master
This worked for me! 80.77% increase. I also had to uncomment this line:
############################################
## enable resulting html compression
php_flag zlib.output_compression on
Worked but not nearly 235% — but step by step. Trying to find other things to optimize as well.
Thank you for this.
Thanks! I hope this helps!
Thanks. I am just testing my shop out at the moment, and it speed me up by about 86% or so on the data size for html….. thanks.
Hi, I did as what you told, but when I test with http://www.whatsmyip.org/mod_gzip_test/ it still says that my site is not gzipped. what’s problem, I think I did everything right.
thanks.
nice, 71% faster.
Was dead slow before but now works pretty nice
It doesn’t work at all… It’s still slow…
Hey
The gzip tester has been renamed and redesigned a little bit. It’s new address is: http://www.whatsmyip.org/http_compression/
It’s also a bit more comprehensive. Some funny servers were saying they weren’t compressing data when they were. Now it doesn’t ask the server if it’s compressing, it manually checks itself every time.
wow, has definitley speeded the site up thanks, but the compression checker still says its not gzipped.
Thanks anyways
Marty
Im kinda new to magento, could anyone tell me where .htaccsess is located ?
Will this work on litesped servers ?
Simply amazing trick!!! That made a HUGE difference
Cheers.
This should just be an automatic thing that is checked for and applied if available during installation – crackers!
Absolutely incredible. WHAT A DIFFERENCE! Thanks for this, but why oh why isn’t this implemented as standard!??? Cheers again!
I do follow this.
After that my site is down?
What’s happen?
I use my old .htaccess But my site is donw.
How can I do?
It’s ok my hosting have some problem about cache.
Sorry.
My web is very fast!
You can try. (My hosting is in Thailand)
http://www.clothes.in.th
Has anyone had issues with the site displaying correctly in safari after this fix. We found it pretty unusable as safari would not load certain images and grid would jump the page. I found a link in the forums of someone talking about safari having a bug that did no allow proper gzip.
Thankyou so much! my site actually version 1.3.2 is very fast after this simple modification!! It’s great!!
For all its not solved, remember clean the magento cache after modification of .htaccess..
Hey guys,
this worked great for me, now i get 83.4% of data savings and dramatically improved my load time from 27.5 seconds to 2.75.
Great!!!!!!
Thanks!
really helping man 200% easy thanks!!!!
still not working for me
Thanks for the solution. worked great
I did this but i also noticed a difference, perhaps its new in 1.4.0.1 that i’m using… what should i do for this line…
# Insert filter on selected content types only
# AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript
I uncommented it but i’m really not sure…
also, i don’t notice any difference. What else do i have to do after changing the htaccess? do i have to manually zip the files myself?
It gained 80% of it’s speed!!!
Thanks it finally feels like a “normal” page!!
Sooooooooo relieved!
This seems to be valid for old versions of magento . New version does have this functionality already. If i’m wrong then please correct me. Thanks
Hi,
I’ve just enabled the Gzip on the server (win 2003 standard with iis 6).
Now, i have confirmed that the server as the Gzip activated with the test to a domain in the same server but when i try to test it on the Magento domain…it inst activated.
Test Tool
http://www.whatsmyip.org/http_compression/
Domain in the same server
http://directo.tr2k.com/login.aspx
Domain with MAGENTO
http://www.rockartstore.com/index.php/
The .htaccess doest work on IIS so that’s not a solution…iv tried in the php.ini only seems to work on Apache.
Any suggestions?
Is there a place were i can enable it in the admin panel?
I’ve tried in on 1.4.0.1 and I keep getting a 500 error message, do you know what the problem might be?
Thanks
w00t! Thanks this helped a little
Very usefull is also MTurbo accelerator for Magento http://www.artio.net/magento-extensions/m-turbo-accelerator
Thanks, It worked
It’s useless
It is network traffic.
Not assoicated with performance.
235 % ?
YOU stupid………….
I agree.
What a useless thing to do.
Making things faster.. THATS NOT HOW THE INTERNET WORKS!!
It’s ONE SPEED.
Everything is 100% as fast as it can go, performance can’t be improved this way!
*End Sarcasm*
I get internet 500 error
what to do?
Great! Thank you.