Magento tips and tricks to speed up loading and performance.

Posted by Damodar Bashyal on October 19, 2011

 

I followed these few steps to speed up magento. Still working on few more steps. So, I'll keep adding new item as I go. If you know any that worked for you please let me know.

  1. Select magento database and repair (if necessary) + optimize it. You can use phpmyadmin for easy perform.
  2. Combine Javascript and Combine CSS files: System ->Configuration ->Advanced ->Developer -> 'Javascript settings' and 'CSS Settings'.
    or,
    Install Fooman_Speedster from magento connect. Visit: http://www.magentocommerce.com/magento-connect/fooman-speedster.html for installation key.
    After installing Fooman_Speedster version 2.0+ extension via Magento Connect make sure that /lib/minify/m.php is executable (permissions like 755 on the file itself and the containing folder should work) and /var/minifycache is writeable.
  3. Turn on caching at: System > Cache Management > enable all.
  4. On .htaccess enable GZip at:
    <IfModule mod_deflate.c>
        ############################################
        ## 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
    </IfModule>        
            
  5. Duplicate php.ini.sample on root of installation and rename to php.ini and modify. E.g. increase memory to equal or more than 128M, turn zlib.output_compression = on etc.
  6. Go through each modules and disable that you don't use or need at: System -> Configuration -> Advanced -> Advanced.
  7. Disable the Magento log: System -> Configuration -> Advanced -> Developer -> Log Settings (default is disabled).
  8. Enable the Magento Flat Catalog.
  9. Don't use layered navigation if you don't really need it, it's resource intensive.
  10. Unless your site is running on multiple servers save your session on files. so, they are accessed faster and let the database size to stay smaller for more performance.
  11. Optimize your images with: http://www.smushit.com/ysmush.it/
  12. Set only those attribute frontend properties to 'Yes' that you're actually going to use. Set all other to 'No'. Don't use in quick search, advanced search compare, etc: Catalog -> Attributes -> Manage Atributes -> Frontend Properties.
  13. If you can upgrade to latest Magento but always create a staging site first and compare.
  14. 404 images on magento can really slow down your magento store. So, you need to take care of those missing images because magento loads 404 pages for every missing files. To optimize your magento store, just add below code on your .htaccess file and upload 1px transparent image on below path.

    <FilesMatch "\.(jpg|jpeg|png|gif|bmp)">
        ErrorDocument 404 "/media/magento/optimization/images/1.png"
    </FilesMatch>
    

    Or, on apache config file as:

    <Directory path_to_magento_dir>
        <FilesMatch "\.(jpg|jpeg|png|gif|bmp)">
            ErrorDocument 404 "/media/magento/optimization/images/1.png"
        </FilesMatch>
    </Directory>
    
  15. Stay tuned for more magento optimisation tips and tricks. If you know any optimization trick, below write down below on comment section. 

Magento 1.7 Development posted on - Tuesday 1st of May 2012 01:03:18 PM

Great tips..I want to say that this article is amazing, nice written and define.

Medidor de ph posted on - Monday 14th of January 2013 07:40:08 PM

Great tips, thanks my store is now faster
 
not published on website


QR Code: Magento tips and tricks to speed up loading and performance.