Try our conversational search powered by Generative AI!

Master key for StaticallyCacheFor

Vote:
 

Hi,

If I do something like this:

cache.Insert(
	key, 
	value,
	new CacheEvictionPolicy(
		null,
		new string[] { "otherKey" },
		new string[] { "MasterKey" },
		new TimeSpan(0, 5, 0),
		CacheTimeoutType.Absolute);

What should "MasterKey" be if I want invalidation to occur when StaticallyCacheFor is invalidated.

Regards Niklas

#177132
Apr 04, 2017 11:50
Vote:
 

Not clear what new string[] { "otherKey" } is here, is that the parameter cacheKeys? If that's the case, that key must already exist in the cache, otherwise just leave it empty (null).

I'm not completely sure here, but I'm pretty sure the Find cache is using IContentCacheKeyCreator.VersionKey, which is the same key output cache is using. In any case, it should be safe to use since that key is invalidated everytime content or lists are changed.

#177161
Edited, Apr 04, 2017 18:22
Vote:
 

Did you solve your issue?

#177488
Apr 12, 2017 19:29
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.