Magento Performance Optimizations

Article ID #1069
Revision: 1.7
Last 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.

  • Check your site at http://www.webpagetest.org/
  • Check your site at http://gtmetrix.com/
  • 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.
  1. 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
  2. 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:
    • General configuration > Update periodically the JS/CSS compressed files: No (default)
    • CSS Compression / Optimization
      • Enabled: Yes
      • CSS Minify Type: CSS Tidy (Recommended)
      • CSS Tidy config options: High (moderate readability, smaller size)
      • the default settings for the rest of options here should be sufficient
    • Javascript compression/optimization
      • Enabled: Yes
      • JS Minify Type: JSMin (good ratio)
      • the default settings for the rest of options here should be sufficient
  3. Use sprites. A sprite combines multiple background images into a single image. You can check this page for detailed information on this technique: http://developer.yahoo.net/blog/archives/2007/04/rule_1_make_few.html

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:

  • Navigate to System > Configuration > Advanced > System. In the Log Cleaning section:
    • reduce Save Log, Days as it seems reasonable to you (how long compare list of your unauthenticated visitor should be saved for?)
    • set Enable Log Cleaning to yes
  • at the store properties screen in Magenting panel enable cronjob tasks for your Store by clicking the Enable Cron button
Did this article help you solve your issue?


Average rating: 3.94 (34 votes)

completely useless 1 2 3 4 5 most valuable

Tags: , ,