@@ 61-70 (lines=10) @@ | ||
58 | * @param Varien_Object $eventObject |
|
59 | * @return null |
|
60 | */ |
|
61 | public function setFlagHeaders($eventObject) { |
|
62 | $response = $eventObject->getResponse(); |
|
63 | if (Mage::helper('turpentine/esi')->shouldResponseUseEsi()) { |
|
64 | $response->setHeader('X-Turpentine-Esi', |
|
65 | Mage::registry('turpentine_esi_flag') ? '1' : '0'); |
|
66 | Mage::helper('turpentine/debug')->logDebug( |
|
67 | 'Set ESI flag header to: %s', |
|
68 | (Mage::registry('turpentine_esi_flag') ? '1' : '0') ); |
|
69 | } |
|
70 | } |
|
71 | ||
72 | /** |
|
73 | * Allows disabling page-caching by setting the cache flag on a controller |
@@ 31-42 (lines=12) @@ | ||
28 | * @param mixed $eventObject |
|
29 | * @return null |
|
30 | */ |
|
31 | public function setCacheFlagHeader($eventObject) { |
|
32 | $response = $eventObject->getResponse(); |
|
33 | if (Mage::helper('turpentine/varnish')->shouldResponseUseVarnish()) { |
|
34 | $response->setHeader('X-Turpentine-Cache', |
|
35 | Mage::registry('turpentine_nocache_flag') ? '0' : '1'); |
|
36 | if (Mage::helper('turpentine/varnish')->getVarnishDebugEnabled()) { |
|
37 | Mage::helper('turpentine/debug')->logDebug( |
|
38 | 'Set Varnish cache flag header to: '. |
|
39 | (Mage::registry('turpentine_nocache_flag') ? '0' : '1') ); |
|
40 | } |
|
41 | } |
|
42 | } |
|
43 | ||
44 | /** |
|
45 | * Add a rewrite for catalog/product_list_toolbar if config option enabled |