Setting Sitecore 8.1 Caching Timeout

How to set render caching timeout in sitecore 8.1?

I applied the code suggested in the link below, but didn't work.

http://www.reinoudvandalen.nl/blog/add-sliding-expiration-on-sitecore-rendering-cache/

I am also trying to add the code below to the controller action method, but still does not work.

RenderingContext.CurrentOrNull.Rendering.Caching.Timeout = new TimeSpan(0, 0, 10);

Is there any other way that I could try to set a timeout for each rendering?

+4
source share
1 answer

You can use this attribute (over an action) to set the cache timeout:

 [OutputCache(Duration = 200)]
 public ActionResult ProductDetail()
 {
   ....
+1
source

Source: https://habr.com/ru/post/1620115/


All Articles