Magento Page Speed Improvements

By 12th March 2013Development
Magento speed improvements

Anyone who has used Magento for an extended period of time knows that although it is packed with features and functionality, it all comes at a cost – performance. With a large database and even larger code base even small stores with less than 100 products can find their Magento site running painfully slow if set up incorrectly. With your sites performance affecting your customers and sales, it is a no brainer to spend the time to optimise your site.

Magento hosting

One of the first things to look at when optimising a Magento site is the hosting. The system is very resource heavy and will simply not perform on standard shared hosting packages, so should only be hosted on Magento specific hosting. Shared Magento hosting can work fine for smaller stores with bigger stores needing dedicated boxes to really be able to stretch their legs.

magento-demo-yslow

Front-end Magento optimisations

Using a tool like Google page speed or YSlow can give you great insights into what is slowing down the rendering of your pages in the browser, and gives you some explanation as to how to improve load times. One of the main issues picked up by these tools with Magento sites are the number of HTTP requests the page is making. The more individual files that need to be loaded on the page, the longer it will take to render. The default Magento theme loads 16 separate javascript files and 3 CSS files. The amount loaded on any Magento site might vary depending on the front end design being used, but reducing this number will help decrease loading times. Magento has a built in feature to merge all JS files and all CSS into just 2 files. You can try this out by enabling the setting in the backend under System->Configuration->Advanced->Developer. You will need to flush the cache after enabling. Depending on the customisation to the theme being used and any extra JS files added, there may be some issues when these files get merged, so it is worth testing thoroughly before enabling on a live site.

JErHJzw[1]

Another thing that page speed or yslow will pick up on in minification of JS and CSS. Minification removes all comments and empty space between the code so compressing it to a smaller size. Magento offers no standard functionality to do this, but you can use a module like UI Optimisation by Diglin to minify all your CSS and JS files. It creates new minified versions so you can still edit the original files when you need to make changes. Combining this minification with the merging functionality in Magento can cut the number of HTTP requests dramatically and improve your page load times.