Boost the speed of your Magento

Featured Image

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%. Let’s start speeding up Magento!

Find the following lines in your Magento .htaccess file and replace them with the following code.

############################################
## 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

# enable resulting html compression
php_flag zlib.output_compression on

118
Top

Enjoyed this post?

Subscribe to our RSS Feed, Follow us on Twitter and spread it to your friends!

Author

Tomislav is an owner and CEO of Inchoo. Enjoys traveling, traditional cuisine (from most cultures), good wine and strong rakija.

Other posts from this author

Discussion 118 Comments

1 2 3
Add Comment
  1. # enable resulting html compression
    php_flag zlib.output_compression on
    also caused my site to throw a 500 error, but after taking it out the site is still 75% faster. Thanks for the great advice!

  2. I’ve seen a similar saving with my magento website. Thanks so much for sharing! This is a MUST if you run on a shared hosting package!

  3. Ziyad

    WOW!!!
    This just works. Thanks

  4. Scott

    TinyBrick’s LightSpeed module has some pretty impressive results when it comes to speeding up Magento. The price might be a little steep, but the performance increases I’ve seen are totally worth it.

    You can see it here: [a href="http://zfer.us/4rilY"]TinyBrick’s Magento LightSpeed Module[/a]

  5. Eriko

    Incredible !! Has solved my problem. On a clean mgto instalation admin panel go so so very very slow, and some times don’t answer.

    I have folow this sugestion, and now, is excelet fast.

    Thanks very very much for an excelent solution. ;)

    Regards,

  6. this is awesome. just what i needed. thanks.

  7. Soumyajyoti Dutta

    I need to make my magento site faster. There fore I applied your setting in htaccess but

    # enable resulting html compression
    php_flag zlib.output_compression on

    particular code giving 500 error. Once removing the code the site runs but not faster.

    How can I add this compression code and if I need to set anything in server, then how can I do that one. Please guide as your help will be entirely grateful for me.

  8. flash

    this is throwing the same 500 server error for me as well. I removed the last line starting with “php” and the site is back up but not sure if speed is up or down.

    Any one have any suggestions? My magento version is 1.5.1.0

  9. great tip, my magento sites are now realy faster :)

  10. Thank you for providing insight on the magento platform!
    Very robust software and many tweaks available.

    All the best!

  11. Joanna

    Holy crap, my site just went supersonic! THANKS A BILLION!

  12. Server error 500 solved.

    I had as well this error and found that I needed to enable mod_headers. On Ubuntu a2enmod headers
    Hope this helps somebody.

  13. sirpsycho

    Major props to you bro. this was an excellent solution. we have 50+ sites and they were all running super super slow, now they’re lighting fast!! thanks again

  14. Dani

    Thank you so much for this post.
    I have applies it on ver 1.3.2.4 and it works like charm.
    Is there more tricks to speed it further? :)
    I just like Formula 1

  15. Awesome! It is a night and day difference. Excellent post. Deep thanks and God bless!

  16. What a difference! Thank you so much for spreading the love around.

    You can see the difference here http://tools.pingdom.com/fpt/

    Our site with over 5k products loads in half the time now. Amazing!

    Allan

  17. thanks my site is faster now

  18. Amazing!
    This is why I love you guys!
    85% increase in 3 minutes!

    Also got the 500 error at first.

1 2 3

Add Your Comment

Please wrap all source codes with [code][/code] tags.
Top