/** * {@inheritdoc} */ public function getCacheKeyInfo() { $info = parent::getCacheKeyInfo(); $blockId = $this->getBlockId(); if ($blockId) { $info[] = 'CMSBLOCK_' . $blockId; } return $info; }
/** * Retrieve values of properties that unambiguously identify unique content * * @return array */ public function getCacheKeyInfo() { $blockId = $this->getBlockId(); if ($blockId) { $result = array('CMS_BLOCK', $blockId, Mage::app()->getStore()->getCode()); } else { $result = parent::getCacheKeyInfo(); } return $result; }
/** * Get generic key array including handle etc, that all blocks use * * @param Mage_Core_Block_Abstract $block * @return array */ protected function _getBasicKeys(Mage_Core_Block_Abstract $block) { $keys = $block->getCacheKeyInfo(); if (!is_array($keys)) { $keys = array(); } $keys[] = Mage::getSingleton('customer/session')->getCustomer()->getGroupId(); $keys[] = Mage::app()->getStore()->getCurrentCurrencyCode(); $keys[] = $block->getLayout()->getUpdate()->getCacheId(); $keys[] = 'SSL_' . intval(!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') . '_'; return $keys; }
/** * Emulate 'account links' block with persistent data * * @param Mage_Core_Block_Abstract $block */ public function emulateAccountLinks($block) { $this->_applyAccountLinksPersistentData(); $block->getCacheKeyInfo(); $block->addLink(Mage::helper('persistent')->getPersistentName(), Mage::helper('persistent')->getUnsetCookieUrl(), Mage::helper('persistent')->getPersistentName(), false, array(), 110); $block->removeLinkByUrl(Mage::helper('customer')->getRegisterUrl()); $block->removeLinkByUrl(Mage::helper('customer')->getLoginUrl()); }
/** * {@inheritdoc} */ public function getCacheKeyInfo() { $info = parent::getCacheKeyInfo(); $pageId = $this->getPageId(); if ($pageId) { $info[] = 'CMSPAGE_' . $pageId; } return $info; }
/** * Emulate 'account links' block with persistent data * * @param Mage_Core_Block_Abstract $block */ public function emulateAccountLinks($block) { $this->_applyAccountLinksPersistentData(); $block->getCacheKeyInfo(); $helper = Mage::helper('Mage_Persistent_Helper_Data'); $block->addLink($helper->getPersistentName(), $helper->getUnsetCookieUrl(), $helper->getPersistentName(), false, array(), 110); $customerHelper = Mage::helper('Mage_Customer_Helper_Data'); $block->removeLinkByUrl($customerHelper->getRegisterUrl()); $block->removeLinkByUrl($customerHelper->getLoginUrl()); }