Can anyone help me in understanding the difference between the expiry we set in respective cache related polices and cache resource(set in envrionment config)?
<PopulateCache async="false" continueOnError="false" enabled="true" name="Populate-Cache-1"> <DisplayName>Populate Cache 1</DisplayName> <Properties/> <CacheKey> <Prefix>empid</Prefix> <KeyFragment ref="empname"/> </CacheKey> <!-- Omit this element if you're using the included shared cache. --> <CacheResource>employeeobject</CacheResource> <Scope>Exclusive</Scope> <ExpirySettings> <TimeoutInSeconds>300</TimeoutInSeconds> </ExpirySettings> <Source>empdata</Source> </PopulateCache>
Let's say cache resource refers the expiry value from environment config("employeeobject" set to expiry after 24 hours) and we have already set Expiry settings in the policy using TimeoutinSeconds whose value is 300 seconds(5min)
Above queries might seem beginner level nonetheless i have to make myself clear about cache.
Please someone help me and also correct me if i understood it wrongly.
Thanks a lot
Thanks and Regards,
Mani
Solved! Go to Solution.
The expiry (TimeoutInSeconds) in the policy will be used.
That Source element is not a cache, so it cannot be considered to be a "shared cache". The Source element specifies the context variable that the policy will use for the source data, which will be placed into cache. The "omit this element" comment applies to the CacheResource element. Check the documentation for details on what it does. The CacheResource element governs whether the policy will use a named cache resource or not. And if using a named cache resource, then the policy will utilize the metadata configured for that cache resource, including maximum number of elements, and so on. In all cases the policy TimeoutInSeconds element, if it is specified, will override the cache resource settings. You can easily test this.
Yes, the Cache key is the thing that you use to address the cache item, whether reading or writing the cache. If you use a different cache key, you will be reading or writing a different element in the cache. To configure a LookupCache policy to retrieve an item that has been previously cached with PopulateCache, you must use a CacheKey in LookupCache that produces the same value as the CacheKey used in PopulateCache.
The expiry (TimeoutInSeconds) in the policy will be used.
That Source element is not a cache, so it cannot be considered to be a "shared cache". The Source element specifies the context variable that the policy will use for the source data, which will be placed into cache. The "omit this element" comment applies to the CacheResource element. Check the documentation for details on what it does. The CacheResource element governs whether the policy will use a named cache resource or not. And if using a named cache resource, then the policy will utilize the metadata configured for that cache resource, including maximum number of elements, and so on. In all cases the policy TimeoutInSeconds element, if it is specified, will override the cache resource settings. You can easily test this.
Yes, the Cache key is the thing that you use to address the cache item, whether reading or writing the cache. If you use a different cache key, you will be reading or writing a different element in the cache. To configure a LookupCache policy to retrieve an item that has been previously cached with PopulateCache, you must use a CacheKey in LookupCache that produces the same value as the CacheKey used in PopulateCache.
Thank you very much @dino for such a nice explanation,
however i struck up with "shared cache" in the cache related policies. Would you please help me in this aspect too?
User | Count |
---|---|
2 | |
1 | |
1 | |
1 | |
1 |