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
-login
For this I created different observers, this is just one of them:
 <checkout_cart_product_add_after>
 <observers>
 <save_data_into_session>
 <type>singleton</type>
 <class>company_modulname/observer</class>
 <method>saveData</method>
 </save_data_into_session> 
 </observers>
 </checkout_cart_product_add_after> 
I don't need anything else, I just need to store value to session or cookie.
Problem:
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– JohnyFree2015年09月07日 16:46:22 +00:00Commented Sep 7, 2015 at 16:46
- 
 Ah, no it can be done. But it'll never be cached :) so your observer should just work fineSander Mangel– Sander Mangel2015年09月07日 16:47:08 +00:00Commented Sep 7, 2015 at 16:47
Explore related questions
See similar questions with these tags.