varybyparam

Manual outputcache refresh

一曲冷凌霜 提交于 2021-02-11 00:32:21
问题 Right now I have OutCache on an action with duration set to 365 days. However depending on some events I would like to clear the cache and there are multiple conditions for clearing cache. Moreover, VaryByParam is not an option. How can I achieve this? I think I can do something like this, store a variable in cookie like: RefreshCache = false and check this in VaryByCustom override method. Incase the RefreshCache evaluates to true, reset it to false, increment VaryByCustom argument variable

Manual outputcache refresh

℡╲_俬逩灬. 提交于 2021-02-11 00:31:11
问题 Right now I have OutCache on an action with duration set to 365 days. However depending on some events I would like to clear the cache and there are multiple conditions for clearing cache. Moreover, VaryByParam is not an option. How can I achieve this? I think I can do something like this, store a variable in cookie like: RefreshCache = false and check this in VaryByCustom override method. Incase the RefreshCache evaluates to true, reset it to false, increment VaryByCustom argument variable

How to implement VaryByCustom caching?

纵饮孤独 提交于 2020-01-02 00:43:10
问题 I'm trying to implement functionality to cache certain pages depending on the host. This is because I can have multiple versions of a page which have the same parameters, and where the only difference in terms of a request is the host that is being requested. So, for example these two URLs will request the same page, but they are styled differently: http://www.a.com/something/specific and http://www.b.com/something/specific I'm going through the example outlined here: http://msdn.microsoft

How to implement VaryByCustom caching?

情到浓时终转凉″ 提交于 2019-12-04 23:19:06
I'm trying to implement functionality to cache certain pages depending on the host. This is because I can have multiple versions of a page which have the same parameters, and where the only difference in terms of a request is the host that is being requested. So, for example these two URLs will request the same page, but they are styled differently: http://www.a.com/something/specific and http://www.b.com/something/specific I'm going through the example outlined here: http://msdn.microsoft.com/en-us/library/5ecf4420%28v=VS.90%29.aspx but it's not making sense to me. I've added this to my