The Cacheable attribute that may be applied to models in custom module developments contains a parameter for CacheTimeOut. How is this parameter used to calculate cache expiration time?
https://github.com/dnnsoftware/Dnn.Platform/blob/584b0f54bd6b6d237594dd9f96053f14db0b1a53/DNN%20Platform/Library/ComponentModel/DataAnnotations/CacheableAttribute.cs#L81 states that the CacheTimeOut parameter is multiplied by the "Host Performance Setting to determine the actual timeout value" - Where is the "Host Performance Setting" that this is referencing? What are the corresponding times used to calculate Sliding expiration in seconds, milliseconds or other time-based values?
I am following this because I also have the same question, would be nice to add the details of how this works in the new Dnn Docs when we know the details.
The CacheTimeOut parameter is multiplied by the PerformanceSetting
The default value for CacheTimeOut is 20. Lets say you have HeavyCaching enabled. This would cache _most_ objects for 2hrs (120minutes). However, some core objects use non-default CacheTimeOut values.
For example, portal aliases are have an initial value of 200 (so 20hrs cached in HeavyCaching). On the shorter side of things, Captcha tokens have a CacheTimeOut value of 2 (6mins in HeavyCaching). You should be able to sit on a page for 5 minutes in that configuration and the Captcha token would still be valid, however if you waited 7 minutes it should fail.
Thanks @ohine! This answered my question.
Anytime! I鈥檓 going to close this issue. If you have any other issues related, feel free to reopen it.
Most helpful comment
The
CacheTimeOutparameter is multiplied by thePerformanceSettinghttps://github.com/dnnsoftware/Dnn.Platform/blob/435adfc24e7e5c4fa8733a6b1c70dc4effbfecfd/DNN%20Platform/Library/Common/Globals.cs#L119-L137
The default value for
CacheTimeOutis 20. Lets say you haveHeavyCachingenabled. This would cache _most_ objects for 2hrs (120minutes). However, some core objects use non-defaultCacheTimeOutvalues.For example, portal aliases are have an initial value of 200 (so 20hrs cached in
HeavyCaching). On the shorter side of things, Captcha tokens have aCacheTimeOutvalue of 2 (6mins inHeavyCaching). You should be able to sit on a page for 5 minutes in that configuration and the Captcha token would still be valid, however if you waited 7 minutes it should fail.