Magento Performance Optimizations

Article ID #1069
Revision: 1.7Last update: 2012-06-06

There are loads of articles on performance optimization for Magento, most of them usually tells about hosting side optimizations. We take care of optimizations from hosting side on our own. However, still there are a lot of places where page loading time can be optimized drastically without a single change on hosting side and giving fantastic results when combined with our hosting side optimizations. This article is about such changes.

Reducing number of HTTP requests

The very first thing to consider is number of HTTP requests made to load your page. Usually it is about 30-50. With some themes it goes above 100.

Notice that most time is spend on making a connection from browser to server (orange and green bars). Actual content download (blue bars) takes a little actually.

Said so, the performace boost can be achieved by decreasing number of objects to be loaded.

Merge CSS and JS files. We usually enable it by default for all installations. This feature can be enabled from System > Configuration > Advanced > Developer > Merge CSS and Merge JS

Install DIglin_UIOptimization (former Rissip_UIOptimization) extension and configure it to minify CSS and JS. Please make sure to flush cache after the extension installation and re-login into the Admin area. After that please navigate to System > Configuration > Diglin/Rissip > UI Optimization and check the following options:

Nowadays, using sprites does not require deep understanding of CSS/HTML magic and boring maths. Just go to http://spriteme.org/ , drag the bookmarklet into your bookmarks area in your browser, open your site and click the bookmarklet button. The script will do the rest - generate suggestions, show it to you and finally will generate the sprite itself and needed CSS changes to be applied against your CSS.

Using these methods should significally decrease a number of HTTP requests made to your site and as result, significally improve the website speed.

Disable unused modules

The second most important optimization part is to disable unused modules. Sometimes modules are installed just to "check it out", the same functionality can duplicated by several modules, resulting is extra JS/CSS files and extra memory footprint. Some installations even have up to 10 instances of jQuery library loaded by every module, from own location. Not taking into account other lightweight JS-libraries like prototype or sliders.

You can just disable all unused modules (especially if you afraid of deleting something) at System > Configuration > Advanced > Advanced page, just switching the module to Disabled and flushing cache.

Enable cron and log cleaning

By default, Magento logs every visitor's requests to the database. As time goes, the number of records may become enormous and slowing down writes as the table grows. The logging is required only to remember wishlists and compared products for unauthenticated visitors. Search engines, spiders, crawlers and spam-bots surely would not compare anything, so we add them to exclusion list and constantly expanding such list of spiders, excluded from logging.

But still, there are a lot of legit visitors saved there. To ensure that log tables will not get overflown: