Version Notes
N/A
Download this release
Release Info
Developer | Jonathan Selander |
Extension | Made_Cache |
Version | 1.0.7 |
Comparing to | |
See all releases |
Code changes from version 1.0.6 to 1.0.7
app/code/community/Made/Cache/Block/Catalog/Product/List/Product.php
CHANGED
@@ -17,9 +17,10 @@ class Made_Cache_Block_Catalog_Product_List_Product
|
|
17 |
*/
|
18 |
public function getCacheTags()
|
19 |
{
|
20 |
-
|
21 |
-
|
22 |
-
|
|
|
23 |
|
24 |
/**
|
25 |
* Product unique - not category
|
@@ -33,11 +34,11 @@ class Made_Cache_Block_Catalog_Product_List_Product
|
|
33 |
$keys = array();
|
34 |
}
|
35 |
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
|
40 |
-
|
41 |
$_product->getId(),
|
42 |
Mage::app()->getStore()->getCode(),
|
43 |
$_customer->getGroupId(),
|
@@ -45,7 +46,7 @@ class Made_Cache_Block_Catalog_Product_List_Product
|
|
45 |
$_taxCalculator->getRateRequest()
|
46 |
->setProductClassId($_product->getTaxClassId())
|
47 |
)
|
48 |
-
|
49 |
}
|
50 |
|
51 |
/**
|
17 |
*/
|
18 |
public function getCacheTags()
|
19 |
{
|
20 |
+
$tags = array(Mage_Catalog_Model_Product::CACHE_TAG . '_' .
|
21 |
+
$this->getProduct()->getId());
|
22 |
+
return $tags;
|
23 |
+
}
|
24 |
|
25 |
/**
|
26 |
* Product unique - not category
|
34 |
$keys = array();
|
35 |
}
|
36 |
|
37 |
+
$_taxCalculator = Mage::getModel('tax/calculation');
|
38 |
+
$_customer = Mage::getSingleton('customer/session')->getCustomer();
|
39 |
+
$_product = $this->getProduct();
|
40 |
|
41 |
+
return array_merge($keys, array(
|
42 |
$_product->getId(),
|
43 |
Mage::app()->getStore()->getCode(),
|
44 |
$_customer->getGroupId(),
|
46 |
$_taxCalculator->getRateRequest()
|
47 |
->setProductClassId($_product->getTaxClassId())
|
48 |
)
|
49 |
+
));
|
50 |
}
|
51 |
|
52 |
/**
|
app/code/community/Made/Cache/Block/Checkout/Cart/Sidebar.php
CHANGED
@@ -49,7 +49,7 @@ class Made_Cache_Block_Checkout_Cart_Sidebar
|
|
49 |
}
|
50 |
|
51 |
/**
|
52 |
-
*
|
53 |
*
|
54 |
* @return array
|
55 |
*/
|
49 |
}
|
50 |
|
51 |
/**
|
52 |
+
* Save on custom cache tag maintained by observer
|
53 |
*
|
54 |
* @return array
|
55 |
*/
|
app/code/community/Made/Cache/Model/Layout.php
CHANGED
@@ -33,7 +33,8 @@ class Made_Cache_Model_Layout extends Mage_Core_Model_Layout
|
|
33 |
/**
|
34 |
* Aggregate <reference> tags into the final XML to be able to
|
35 |
* determine if child blocks should be instantiated or not, as well as
|
36 |
-
* not try to render blocks in vain
|
|
|
37 |
*
|
38 |
* @return Mage_Core_Model_Layout
|
39 |
*/
|
@@ -94,9 +95,9 @@ class Made_Cache_Model_Layout extends Mage_Core_Model_Layout
|
|
94 |
if (count($esiList)) {
|
95 |
foreach ($esiList as $node) {
|
96 |
$blockName = trim((string)$node);
|
97 |
-
|
|
|
98 |
}
|
99 |
-
array_unique($this->_esiBlocks);
|
100 |
}
|
101 |
|
102 |
return $this;
|
@@ -199,7 +200,7 @@ class Made_Cache_Model_Layout extends Mage_Core_Model_Layout
|
|
199 |
}
|
200 |
}
|
201 |
|
202 |
-
if (in_array($blockName, $this->_esiBlocks)) {
|
203 |
$block->setData('esi', 1);
|
204 |
}
|
205 |
|
33 |
/**
|
34 |
* Aggregate <reference> tags into the final XML to be able to
|
35 |
* determine if child blocks should be instantiated or not, as well as
|
36 |
+
* not try to render blocks in vain. This is also essential for
|
37 |
+
* hole-punching
|
38 |
*
|
39 |
* @return Mage_Core_Model_Layout
|
40 |
*/
|
95 |
if (count($esiList)) {
|
96 |
foreach ($esiList as $node) {
|
97 |
$blockName = trim((string)$node);
|
98 |
+
// Names are unique, an array could hold future settings
|
99 |
+
$this->_esiBlocks[$blockName] = array();
|
100 |
}
|
|
|
101 |
}
|
102 |
|
103 |
return $this;
|
200 |
}
|
201 |
}
|
202 |
|
203 |
+
if (in_array($blockName, array_keys($this->_esiBlocks))) {
|
204 |
$block->setData('esi', 1);
|
205 |
}
|
206 |
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Made_Cache</name>
|
4 |
-
<version>1.0.
|
5 |
<stability>stable</stability>
|
6 |
<license>OSL 3.0</license>
|
7 |
<channel>community</channel>
|
@@ -18,9 +18,9 @@ ESI is supported in conjunction with Phoenix_VarnishCache, and allows for super-
|
|
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-
|
22 |
-
<time>
|
23 |
-
<contents><target name="magecommunity"><dir name="Made"><dir name="Cache"><dir name="Block"><dir name="Catalog"><dir name="Product"><dir name="List"><file name="Product.php" hash="
|
24 |
<compatible/>
|
25 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
26 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Made_Cache</name>
|
4 |
+
<version>1.0.7</version>
|
5 |
<stability>stable</stability>
|
6 |
<license>OSL 3.0</license>
|
7 |
<channel>community</channel>
|
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-13</date>
|
22 |
+
<time>18:53:57</time>
|
23 |
+
<contents><target name="magecommunity"><dir name="Made"><dir name="Cache"><dir name="Block"><dir name="Catalog"><dir name="Product"><dir name="List"><file name="Product.php" hash="6356fde9c5acf5f0a96851e780a691b1"/></dir><file name="List.php" hash="377798f55bcbe90fda0d3dd582bbea77"/><file name="View.php" hash="14a2b6a99872a0fbbfc9e5390f56642b"/></dir></dir><dir name="Checkout"><dir name="Cart"><file name="Sidebar.php" hash="f2c2c2c53e791b94e23ac635894213a0"/></dir></dir><dir name="Cms"><file name="Block.php" hash="e99bc96a3a6cd1bee4658b163b1ee63e"/><file name="Page.php" hash="156f4eb0d9dfd6f8dd0d3fce40f0c356"/><dir name="Widget"><file name="Block.php" hash="3e74a85404ab796bf46db6c36e479d49"/></dir></dir></dir><dir name="Model"><file name="Layout.php" hash="d7ceee78dd8294b32af75280795cc23c"/><file name="Observer.php" hash="3d8aaad098e61bfd20c9701234ec7266"/></dir><dir name="controllers"><file name="VarnishController.php" hash="6ae7446eef83e106c56b0f05711c3ffa"/></dir><dir name="etc"><file name="config.xml" hash="30195c4aad4535bae9f47079c7d851c8"/></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="6a0f95410f1aed85851bcab8437b53e8"/></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>
|