Magento – Improving Speed

Magento has very nice interface, but it seems to me very slow sometime. I wonder if it is because I am in Hong Kong and the server is in US. However, sometime it is really unacceptable slow to me.. so I was trying to figure out how to improve the speed of Magento. One way is to enable mysql query cache, but I find my server’s mysql already turn on the query cache, so it is not the cause. Then I find you can enable compressing data to send to your client, and it seems my Magento store is improved a lot. You may try what I have done to improve your Magento store. 🙂


In order to do this, edit your .htaccess file in Magento Directory:

edit this block (uncomment by removing #):

############################################
## enable resulting html compression

 php_flag zlib.output_compression on

and this (uncomment by removing #):

############################################
## enable apache served files compression
## http://developer.yahoo.com/performance/rules.html#gzip

    # Insert filter on all content
   SetOutputFilter DEFLATE 
    # Insert filter on selected content types only
    AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript

    # 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

Post to Twitter Post to Plurk Post to Yahoo Buzz Post to Delicious Post to Digg Post to Facebook Post to MySpace Post to Ping.fm Post to Reddit Post to StumbleUpon

Leave a Reply