I have an extension which saves some data into session when user makes any of the following action:

-adds/remove product to cart or change qty
-apply coupon code

For this I created different observers, this is just one of them:


I don't need anything else, I just need to store value to session or cookie.


The problem is about cache. I created observer for each action (checkout_cart_product_add_after,checkout_cart_save_after, ...). Some cache extensions caches also logged in user. It will cache everything except block that is required to display user cart. But this means Magento still needs to go through some models I guess.

My question is: Let's say I define observer inside config.xml and cache module caches my block, but it goes through Magento core models required to display cart inside header. Will Magento go through my observer model or not?

1 Answer 1


Since storing data in the session can't be done it will. Customer (user) specific data and page calls will never be cached so you should be good

  • Why storing data in the session can't be done? I am not sure if I understand what you mean.
    – JohnyFree
    Commented Sep 7, 2015 at 16:46
  • Ah, no it can be done. But it'll never be cached :) so your observer should just work fine Commented Sep 7, 2015 at 16:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.