asoares wrote:
I also implemented a CustomCacheAttribute that allows me to flush targeted controller's actions output when needed. So, using the same event system, I can flush both from the nop_static_cache ICacheManager and from my CustomCacheAttribute (which actually don't use the ICacheManager but could I suppose...!) So everything that's called as an action is cached using the OutputCacheAttribute and everything that's not is cached using the ModelCache. When there are ...
Hi, could you develop further on this a little bit? :)
I'm finishing a plugin/widget that displays a dynamic popup category navigation menu using pure CSS, and I've been looking into caching to avoid re-generating the Category tree in every request.
I tried to use MVC 3 OutputCaching in my plugin controller, but it's not working as expected (not varying by 'slug', which is in this case the currentCategoryId -perhaps because the "main" action is invoked by the WidgetManager and is only sending the widgetId parameter, and the action that actually builds the menu is a child action called from the former...) so I looked into using nop's builtin MemoryCache. It works fine and I can invalidate it implementing IConsumer<X>.
The problem is, to mark the 'active' category, I still have to get the current category id and find it in my cached-tree to mark it as Active (and its parent categories optionally).
That's the reason I'm interested in some automation here, if some OutputCache attribute in my plugin controller can handle the different parameters, I think I can live with 1 cached tree for each category in the system.
Any hints/advice would be appreciated :)