Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6824651
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:55:37+00:00 2026-05-26T21:55:37+00:00

I had installed this extension on my Magento store: http://www.magentocommerce.com/magento-connect/catalogcache.html It really improved the

  • 0

I had installed this extension on my Magento store: http://www.magentocommerce.com/magento-connect/catalogcache.html

It really improved the page load time for the catalog listings. The problem is alerts no longer show up. For example if someone subscribes to get notified when a product is back in stock the “Alert successfully added” message appear on page reload..

Does anyone know how I can prevent the alerts from caching?

Here is the code from the extension:

    class Netresearch_CatalogCache_Block_Product_View extends Mage_Catalog_Block_Product_View
/**
 * replace this parent class by your inhereted version of th Product_View Block
 * e.g. class Netresearch_CatalogCache_Block_Product extends MyNameSpace_MyModule_Catalog_Block_Product_View
 */
{
    protected function _isCacheActive()
    {
        if(!Mage::getStoreConfig('catalog/frontend/cache_view')) {
            return false;
        }

        /* if there are any messages dont read from cache to show them */
        if(Mage::getSingleton('core/session')->getMessages(true)->count() > 0) {
            return false;
        }


        return true;
    }

    public function getCacheLifetime()
    {
        if($this->_isCacheActive())
        {
            return false;
        }
    }
/*
    protected function _loadCache()
    {
        $cache = parent::_loadCache();
        Mage::debug($cache===false? "computed":"from cache");
        return $cache;
    }
*/
    public function getCacheKey()
    {
        if(!$this->_isCacheActive()) {
            parent::getCacheKey();
        }
        $_taxCalculator = Mage::getModel('tax/calculation');
        $_customer = Mage::getSingleton('customer/session')->getCustomer();
        $_product = $this->getProduct();
        return 'ProductView'.
            /* Create differnet caches for ...
             * ... for different products */
            $_product->getId().'_'.
            /* ... for different stores */
            Mage::App()->getStore()->getCode().'_'.
            /* ... for different customer groups */
            $_customer->getGroupId().'_'.
      /* ADD CURRENCY CODE TO ID */
      Mage::app()->getStore()->getCurrentCurrencyCode().'_'.
            /* ... for different tax classes (related to customer and product) */
            $_taxCalculator->getRate(
                $_taxCalculator
                    ->getRateRequest()
                    ->setProductClassId($_product->getTaxClassId()
                )
            ).'_'.
            '';
    }


    public function getCacheTags()
    {
        if(!$this->_isCacheActive()) {
            return parent::getCacheTags();
        }
        return array(
            Mage_Catalog_Model_Product::CACHE_TAG,
            Mage_Catalog_Model_Product::CACHE_TAG."_".$this->getProduct()->getId()
        );

    }
}

I asked a similar question here about the store currency and got the solution:
Magento – Don't Cache Currency

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T21:55:37+00:00Added an answer on May 26, 2026 at 9:55 pm

    I don’t use this module but have worked on caching for Magento and used the code below to avoid system messages caching. This may work for you ? You may then try :

    protected function _isCacheActive()
    {
        if(!Mage::getStoreConfig('catalog/frontend/cache_view')) {
            return false;
        }
    
        /* if there are any messages dont read from cache to show them */
        if($this->getMessagesBlock()->getGroupedHtml()) {
            return false;
        }
    
    
        return true;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I had installed the python package named requests . (pip install -i http://pip.kennethreitz.com/simple requests)
I would like to clarify this issue. I had installed Cocos2d 1.01 rc on
I am going through this tutorial , but I already had Ruby 1.8.7 installed.
I had downloaded and installed the 1.6.9 version of SVN from http://subversion.tigris.org/ . After
I just installed VS2010 and the great new IronPython Tools extension. Currently this extension
i had installed the gem carmen successfully and also include it in my gem
I had installed Xcode from the AppStore and I am not sure where it
I was following along with Ryan's RailsCast Episode 339. I had installed rbenv and
Glassfish had already been installed into Netbeans. But I forgot the password and username.
OS X 10.5.8 came with Python 2.5, and had PyObjC already installed. I installed

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.