We’re giving away 3 insider secrets guaranteed to help your Magento shop speed soar.

The most popular open source ecommerce platform is no small snake to wrangle when it comes to performance. We’re going to uncover some hidden gems to help your shop realize its full performance potential. Take note that these tips may require the help of an experienced developer (I happen to know a few, if you’re interested).

Secret 1: New Relic

A well-known feature of Magento is the built-in performance-profiling tool called the Varien Profiler. But did you know that the New Relic monitoring service has even tighter integration options for Magento that can reveal some obvious bottlenecks? New Relic provides software analytics with deep insights into the Magento application framework. It is able to pinpoint where performance problems occur and how they are happening. In less than an hour, you can begin to understand exactly where your site needs to be optimized.

Getting started with New Relic is easy:

  1. Install the monitoring agent on your server (instructions)
  2. Register the agent with your license key (instructions)
  3. Start monitoring performance (instructions)

New Relic provides some fascinating insights about your store that can allow you to easily identify problems and to plan for effective solutions. 

Rick_NewRelic.jpgNew Relic APM for Magento

Take the guess work out of your optimizing and start making changes that produce faster page load times. Click here to learn more about how others are debugging Magento performance issues with New Relic.

Bonus: New Relic is also compatible with Magento 2.

Secret 2: Eliminating Observers

Magento offers a rich event-driven system. For example, when your customers place orders, a series of internal events are emitted that other processes or extensions may observe. Some of these events are necessary for a properly running shop. Yet, some of these can be safely turned off to gain performance, such as those for visitor logs and reporting. Here’s a quick run-down.

How to Disable Observers

From any module’s configuration XML, you can modify existing observers to disable them. Here’s a sample:

...
<frontend>
     <events>
         <controller_action_predispatch>
             <observers>
                 <log>
                     <type>disabled</type>
                 </log>
             </observers>
         </controller_action_predispatch>
        ...

The key here is in setting the type value to disabled. Knowing this, you can disable any observer in the system. Continue reading to learn where you can apply these changes for faster site performance.

Disable Visitor Logging

Visitor logging is a feature of Magento that tracks customers flowing through your pages. Unfortunately, the metrics provided do not yield the same insight as the offering of many third-party analytics services. So why not disable them in return for some site speed?

These observers are defined in app/code/core/Mage/Log/etc/config.xml and target the following events:

  • controller_action_predispatch
  • controller_action_postdispatch
  • customer_login
  • customer_logout
  • sales_quote_save_after
  • checkout_quote_destroy
 
Disable Core Reporting

The Magento reporting tools, like visitor logging, are often pushed aside in favor of more robust reporting services. If your business is not leveraging core reports, then you might consider disabling the related observers in exchange for page speed.

These observers are defined in app/code/core/Mage/Reports/etc/config.xml and target the following events:

  • catalog_product_compare_remove_product
  • customer_login
  • customer_logout
  • catalog_controller_product_view
  • sendfriend_product
  • catalog_product_compare_add_product
  • catalog_product_compare_item_collection_clear
  • sales_quote_item_save_before
  • wishlist_add_product
  • wishlist_share

Although this is not an exhaustive list of event observers, these are often regarded in the industry as easy targets for site speed optimization.

Bonus: Magento 2 offers similar means for eliminating observers.

Secret 3: Cache Product Blocks

A great strength of Magento’s performance capabilities lies in its tightly integrated caching system. Oddly, even though all blocks support caching, only a couple of core blocks actually implement it. One of the best ways to decrease page load time on your store is to setup caching for the product list block.

To do this, you must extend the method getCacheKeyInfo on the block class Mage_Catalog_Block_Product_List. Now we won’t explain how to establish a block rewrite, as this guide is not intended for the beginner. So we’ll jump right into the logic needed for effective cache key generation. See the example below. 

public function getCacheKeyInfo()

{
     $data       = parent::getCacheKeyInfo();
     $category   = Mage::registry('current_category');
 
     if ($category instanceof Mage_Catalog_Model_Category) {
        $data['category_id'] = (int) $categoryId;
     } else {
         $data['category_id'] = 0;
     }

     $data['customer_group'] = (int) Mage::getSingleton('customer/session')->getCustomerGroupId();
     $data['website_id']     = (int) Mage::app()->getWebsite()->getId();
     $data['layer_state']    = $this->getLayer()->getStateKey();
 
     return $data;
}

Here we are simply declaring the degrees of variation on the product list block, such that it can be cached for performance gains without being displayed improperly and to the wrong customer. One of the best things about this tip is that with a very low level of effort, you can fully cache one of the most heavily used blocks in the entire system.

Magento is a complex and highly scalable ecommerce platform. While it was built for performance, we can all agree that reality does not always meet expectactions. With these 3 lesser known optimizations, you can squeeze even more out of your site’s performance capabilities.

So when you think you’ve tried everything to optimize your Magento shop, here are 3 more secrets to maximize performance!

Speaking of site speed, is your store prepared for around-the-clock holiday sales? Get the Ultimate Guide. 

New Call-to-action  

Rick Buczynski
Products & Services Manager Certified Magento Developer

Talk to Us

Tell us about your goals and we'll discover together how Groove can help you meet them.