Pinoy2015
Pinoy2015

Reputation: 1459

Set Caching timeout Sitecore 8.1

How to set the caching timeout of renderings in sitecore 8.1?

I applied the code suggested in the below link but did not work.

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

I also try adding the below code in action method of a controller but still not working.

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

Is there any other way I could try so I could set timeout for each rendering?

Upvotes: 4

Views: 939

Answers (1)

Santiago Morla
Santiago Morla

Reputation: 377

You could use this attribute (above the action) to set a cache timeout:

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

Upvotes: 1

Related Questions