A simple module that adds cache information to
Mage_Catalog_Block_Product_List - thereby enabling block caching on
This module was created for a tutorial on Minute.no.
Why would you install this?
You might be familiar with Magento's block caching system. It is great. It works. Except it is barely enabled on a default installation of Magento.
One of the most resource intensive templates in Magento is the category page. The dominant block on most category
pages is the product list block. Or
Mage_Catalog_Block_Product_List to be precise.
This module overrides
Mage_Catalog_Block_Product_List by adding some caching information which in turn will enable
caching for product lists. The product prices will be correct no matter who is logged in.
How much increase in performance can I expect?
On Enterprise Edition with full page caching enabled: 0. Why? Because block caching is disabled while FPC is enabled.
On Community Edition: 2 x performance increase on cached category pages
The results are highly unscientific and is based on loading the
accessories/shoes.html page on a clean install of
Magento 1.9.1 with Magento's sample data installed.
Results from Blackfire.io
Here are the results from Blackfire.io:
Cached category page
|Measurement||Module disabled||Module enabled||Diff. in %|
|Wall Time||1 s||483 ms||- 52 %|
|I/O||103 ms||27.8 ms||- 73 %|
|CPU Time||900 ms||455 ms||- 49 %|
|Memory||37.1 MB||33.4 MB||- 10 %|
This means that - roughly - your site will be able to render twice as many category pages per minute if this module is enabled.
Make sure you have modman.
$ cd /path/to/your/magento $ modman clone https://github.com/siment/St_ProductListBlockCache.git
Download files and copy to your Magento root
- Added form key used in "add to" links to cache key info of products list block. (Thank you, @p-makowski)
- Fixed typo in vendor name in
composer.jsonto make module compatible with Composer installation.
- Syntax changes to
Now supports language and currency switching:
- Added locale code to cache key info
- Added currency code to cache key info
- Adding request URI to cache key to acommodate for filters and page numbers. It is not really that useful to have category page caching persist across URIs. I might improve on this later.
- Minor change to modman files.
- Initial commit. Basic functionality in place.