Made_Cache - Version 1.0.1

Version Notes

N/A

Download this release

Release Info

Developer Jonathan Selander
Extension Made_Cache
Version 1.0.1
Comparing to
See all releases


Code changes from version 1.0.0 to 1.0.1

app/code/community/Made/Cache/Model/Layout.php CHANGED
@@ -99,6 +99,8 @@ class Made_Cache_Model_Layout extends Mage_Core_Model_Layout
99
  if (empty($parent)) {
100
  $parent = $this->getNode();
101
  }
 
 
102
  $parentName = $parent->getAttribute('name');
103
  if ($parentName) {
104
  if (!isset($this->_blocks[$parentName])) {
99
  if (empty($parent)) {
100
  $parent = $this->getNode();
101
  }
102
+
103
+ // Don't cache children if parent is already cached
104
  $parentName = $parent->getAttribute('name');
105
  if ($parentName) {
106
  if (!isset($this->_blocks[$parentName])) {
app/code/community/Made/Cache/Model/Observer.php CHANGED
@@ -8,34 +8,6 @@
8
  */
9
  class Made_Cache_Model_Observer
10
  {
11
- /**
12
- * Correctly clear product cache
13
- *
14
- * @param Varien_Event_Observer $observer
15
- * @return type
16
- */
17
- public function clearProductCache(Varien_Event_Observer $observer)
18
- {
19
- $_product = $observer['item']->getProduct();
20
- if (trim(Mage::getStoreConfig('catalog/frontend/refresh_cache_when_stock_is')) == "") {
21
- $_product->cleanCache();
22
- return;
23
- }
24
-
25
- $_currentStock = $_product->getStockItem()->getQty();
26
- $_futureStock = $_currentStock - $observer['item']->getQty();
27
- $stocks = explode(',',','.Mage::getStoreConfig('catalog/frontend/refresh_cache_when_stock_is'));
28
-
29
- foreach ($stocks as $stock) {
30
- $stock = trim($stock);
31
-
32
- if ($stock && $_currentStock > $stock && $_futureStock <= $stock) {
33
- $_product->cleanCache();
34
- return;
35
- }
36
- }
37
- }
38
-
39
  /**
40
  * Clear product cache after a review is saved
41
  *
8
  */
9
  class Made_Cache_Model_Observer
10
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  /**
12
  * Clear product cache after a review is saved
13
  *
app/code/community/Made/Cache/etc/config.xml CHANGED
@@ -9,7 +9,7 @@
9
  <config>
10
  <modules>
11
  <Made_Cache>
12
- <version>1.0.0</version>
13
  </Made_Cache>
14
  </modules>
15
  <global>
@@ -41,15 +41,6 @@
41
  </cache_review_save_after>
42
  </observers>
43
  </review_save_after>
44
- <sales_convert_quote_item_to_order_item>
45
- <observers>
46
- <cache_order_success>
47
- <type>singleton</type>
48
- <class>cache/observer</class>
49
- <method>clearProductCache</method>
50
- </cache_order_success>
51
- </observers>
52
- </sales_convert_quote_item_to_order_item>
53
  <core_block_abstract_to_html_after>
54
  <observers>
55
  <cache_add_esi_tags>
9
  <config>
10
  <modules>
11
  <Made_Cache>
12
+ <version>1.0.1</version>
13
  </Made_Cache>
14
  </modules>
15
  <global>
41
  </cache_review_save_after>
42
  </observers>
43
  </review_save_after>
 
 
 
 
 
 
 
 
 
44
  <core_block_abstract_to_html_after>
45
  <observers>
46
  <cache_add_esi_tags>
app/design/frontend/base/default/layout/madecache.xml CHANGED
@@ -6,7 +6,7 @@
6
  * @copyright Copyright (c) 2011 Made People AB. (http://www.madepeople.se/)
7
  */
8
  -->
9
- <layout version="1.0.0">
10
  <default>
11
  <cache>
12
  <!--
@@ -15,13 +15,11 @@
15
  -->
16
  <name lifetime="86400">left</name>
17
  <name>head</name>
18
- <name>header</name>
19
  <name>breadcrumbs</name>
20
  <name>after_body_start</name>
21
  <name>before_body_end</name>
22
  <name>product.info</name>
23
  <name>product_list</name>
24
- <name>product_list_toolbar</name>
25
  <name>category.products</name>
26
  </cache>
27
  </default>
6
  * @copyright Copyright (c) 2011 Made People AB. (http://www.madepeople.se/)
7
  */
8
  -->
9
+ <layout version="0.1.0">
10
  <default>
11
  <cache>
12
  <!--
15
  -->
16
  <name lifetime="86400">left</name>
17
  <name>head</name>
 
18
  <name>breadcrumbs</name>
19
  <name>after_body_start</name>
20
  <name>before_body_end</name>
21
  <name>product.info</name>
22
  <name>product_list</name>
 
23
  <name>category.products</name>
24
  </cache>
25
  </default>
package.xml CHANGED
@@ -1,28 +1,26 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Made_Cache</name>
4
- <version>1.0.0</version>
5
  <stability>stable</stability>
6
  <license>OSL 3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
- <summary>Advanced Block Cache module that enhances performance by implementing cache on the most common blocks.</summary>
10
  <description>Few know that Magento out of the box doesn't actually cache anything other than the Navigation and Footer blocks, which are basically static as it is.&#xD;
11
  &#xD;
12
  This module enhances performance by allowing developers to cache any block they want via simple layout xml changes - per layout handle.&#xD;
13
  &#xD;
14
  There is also support for disabling cache for specific handles such as checkout, etc, where you don't want to load the main content block from cache.&#xD;
15
  &#xD;
16
- The product view and list blocks contain specific cache tags that takes the customer, tax rules and so on into concern.&#xD;
17
  &#xD;
18
- A good block cache is vital for scaling a site, be sure to implement this before residing to full page cache or similar.&#xD;
19
- &#xD;
20
- Consider a good layout with dynamic information grouped and a simple hierarchy, to maximize performance.</description>
21
  <notes>N/A</notes>
22
- <authors><author><name>Jonathan Selander</name><user>jonathan_made</user><email>jonathan@madepeople.se</email></author></authors>
23
  <date>2012-05-07</date>
24
- <time>18:56:16</time>
25
- <contents><target name="magecommunity"><dir name="Made"><dir name="Cache"><dir name="Block"><dir name="Catalog"><dir name="Product"><file name="List.php" hash="b6c67645954d1a8c2175b7d98fad68e4"/><file name="View.php" hash="3670f5e5a739283783c446bdb6abf364"/></dir></dir></dir><dir name="Model"><file name="Layout.php" hash="4d8c066991271a812b9ad039b6eaedd6"/><file name="Observer.php" hash="264bad67caf1661156811fa6ae07e634"/></dir><dir name="controllers"><file name="VarnishController.php" hash="6e7207e07c5385568061b853eeca96fd"/></dir><dir name="etc"><file name="config.xml" hash="0bac4b8c124a1cf0b9b4bfe0ebb3fbaa"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Made_Cache.xml" hash="4cf53cc9b4e525eb560f7fe1278d96bd"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="madecache.xml" hash="ed18df239d381566002dafa34ffa66f6"/></dir></dir></dir></dir></target></contents>
26
  <compatible/>
27
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
28
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Made_Cache</name>
4
+ <version>1.0.1</version>
5
  <stability>stable</stability>
6
  <license>OSL 3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
+ <summary>Advanced Block Cache module that enhances performance by implementing cache on the most commonly rendered blocks.</summary>
10
  <description>Few know that Magento out of the box doesn't actually cache anything other than the Navigation and Footer blocks, which are basically static as it is.&#xD;
11
  &#xD;
12
  This module enhances performance by allowing developers to cache any block they want via simple layout xml changes - per layout handle.&#xD;
13
  &#xD;
14
  There is also support for disabling cache for specific handles such as checkout, etc, where you don't want to load the main content block from cache.&#xD;
15
  &#xD;
16
+ ESI is supported in conjunction with Phoenix_VarnishCache, and allows for super-fast page views. Simply add esi="1" to any block XML definition, and the rest is automatic.&#xD;
17
  &#xD;
18
+ A good block cache is vital for scaling a site, be sure to implement it before residing to full page cache.</description>
 
 
19
  <notes>N/A</notes>
20
+ <authors><author><name>Jonathan Selander</name><user>jonathan_monday</user><email>jonathan@mondaycreative.se</email></author></authors>
21
  <date>2012-05-07</date>
22
+ <time>21:00:16</time>
23
+ <contents><target name="magecommunity"><dir name="Made"><dir name="Cache"><dir name="Block"><dir name="Catalog"><dir name="Product"><file name="List.php" hash="b6c67645954d1a8c2175b7d98fad68e4"/><file name="View.php" hash="3670f5e5a739283783c446bdb6abf364"/></dir></dir></dir><dir name="Model"><file name="Layout.php" hash="341ee7acf6a25c7c17aeaa2c194aa5b9"/><file name="Observer.php" hash="6828f5e4b78dd32a52254d03faa0086f"/></dir><dir name="controllers"><file name="VarnishController.php" hash="6e7207e07c5385568061b853eeca96fd"/></dir><dir name="etc"><file name="config.xml" hash="f06d06a97a31ab489316daba027aa41b"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Made_Cache.xml" hash="4cf53cc9b4e525eb560f7fe1278d96bd"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="madecache.xml" hash="3679ea4ed47b428e4c05314bf6bba3ee"/></dir></dir></dir></dir></target></contents>
24
  <compatible/>
25
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
26
  </package>