November Happy Hour will be moved to Thursday December 5th.

Turn off output-cache on spesific page

Vote:
 
I have a problem with caching on a specific page. Default EPiServer caches pages for 3600 minutes. Pages are discriminated by the ID querystring. However there is one spesific pagetype that I do not want EPiServer to cache since it reads some data from another source. There is no logon the site. Any idea for how to disable caching on pages of a specific type? I've been thinging of adding some random noise to the querystring: ThePage.aspx?id=345×tamp=<%#datetime.now%> And then adding 'timestamp' to EPsCacheVaryByParams in web.config. But that only works when I have full control over how the page is linked to. If the link is from a pagelist, or link via the editor this method does not work.
#12134
Sep 27, 2004 13:40
Vote:
 
Try overriding the SetCachePolicy() method in your template. Check if the page should be cached and call base.SetCachePolicy(). If not, try this: base.Response.Cache.SetExpires(DateTime.Now); base.Response.Cache.SetCacheability(HttpCacheability.Private);
#13720
Sep 27, 2004 14:12
* 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.