Here’s a Quick Way to Speedup Magento

19.Mar.2015

We have assembled list of 4 steps needed to seed up Magento with useful links with details on how to implement each of the steps.

We have assembled list of 4 steps needed to seed up Magento with useful links with details on how to implement each of the steps.

In order to implement these changes, you need to have your Magento running on CentOS with root access, and access to WHM admin panel. If you do, then simply follow these steps in order to speed up your Magento:

  1. Install Mod PageSpeed via Easy Apache — Here you can find instructions on how to do it: https://github.com/pagespeed/cpanel
  2. Install .htaccess (content below) on following Magento locations:
    • /media/.htaccess
    • /skin/frontend/tesori/default/.htaccess
    • /js/.htaccess
  3. Go to Magento Admin -> Configuration -> Advanced -> Developer and choose to Merge CSS files
  4. Install Varnish — you can find instructions no how to do it here: http://www.cpanelkb.net/how-to-install-varnish-cache/

Here is the content of .htaccess file from step #2:

############################################
## 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
 
 
 
<FilesMatch ".(ico|pdf|flv|svg|jpg|jpeg|png|gif|swf|js|css|php)$">
Header set Expires "access plus 1 year"
 
 
FileETag MTime Size
 
  <filesmatch ".(jpg|jpeg|gif|svg|png|css|js|php)$">
       ExpiresActive on
       ExpiresDefault "access plus 1 year"