on the controller, so given that each site has its own url it should cache for each site?. Further to this to clear the cache I am going to implement events for published event for home node, so if page being published is home node then i am going to clear cache thus,
var cacheManager = new OutputCacheManager();
//todo check which doc type being published then clear cache
cacheManager.RemoveItems("ProductSurface", "ListProductCarousel");
is it possible to further refine this clear so that i only clear the cache for the current language version? In the event i know which page i am publishing so is there something here that can be done to further refine the clear?
I'm afraid I havent time to look bur you will be able to pull from the cache the exact variant you talk of and just trash that. You're starting to get pretty specialised though, unless you have something on that page that is taking a long time to render I wouldnt risk adding such low level code.
Another option is you could drop the duration and implement a custom cache key via varybycustom. Then from within that static manager you could control the key values by whatever you like. This would mean that your variants stick in the cache until they naturally expire (hence dropping from a day would help your servers RAM).
I have seen the by url that Jeavon and Jeroen have in hybrid framework I did give that a go but did not see any speed improvement so i suspect it did not end up in the cache. Will revisit this when i get a chance.
Donut caching question
Guys,
Here is my situation, i have multi lingual site, each site has its own home node and host name set e.g,
Home - GB
Home - FR
Home - US
you get the picture. Each home node has a product carousel set, i have controller that gets that carousel, so I was thinking of doing
[DonutOutputCache(Duration = 86400, Location = OutputCacheLocation.Server, VaryByCustom = "url")]
on the controller, so given that each site has its own url it should cache for each site?. Further to this to clear the cache I am going to implement events for published event for home node, so if page being published is home node then i am going to clear cache thus,
is it possible to further refine this clear so that i only clear the cache for the current language version? In the event i know which page i am publishing so is there something here that can be done to further refine the clear?
Regards
Ismail
Hey Ismail,
I'm afraid I havent time to look bur you will be able to pull from the cache the exact variant you talk of and just trash that. You're starting to get pretty specialised though, unless you have something on that page that is taking a long time to render I wouldnt risk adding such low level code.
Another option is you could drop the duration and implement a custom cache key via varybycustom. Then from within that static manager you could control the key values by whatever you like. This would mean that your variants stick in the cache until they naturally expire (hence dropping from a day would help your servers RAM).
HTH
Chris
Chris,
I have seen the by url that Jeavon and Jeroen have in hybrid framework I did give that a go but did not see any speed improvement so i suspect it did not end up in the cache. Will revisit this when i get a chance.
Cheers
Ismail
is working on a reply...