Disable cache for user control

Posted by Community Admin on 04-Aug-2018 19:24

Disable cache for user control

All Replies

Posted by Community Admin on 07-Jul-2011 00:00

Hi,
I am working with Sitefinity 4.1.1395.
I want to disable the caching for a user control only. This is the code Im using, but its ineffective.
<%@ OutputCache Duration="1" VaryByParam="none" %>

How can I disable the cache for the control only? I don't want to disable the cache on the entire page.

Thanks

Posted by Community Admin on 07-Jul-2011 00:00

Hi Nidhi,

According to MSDN there are two ways

  • Set options declaratively using the @ OutputCache directive in the .aspx file.

  • Use the methods and properties of the HttpCachePolicy class, which is exposed by the Response.Cache object in the page's code.

The first one - it is possible to do this but for all pages, not for a single one, by replacing frontend root page

www.sitefinity.com/.../ie-9-standards-mode.aspx

The second one would work if you create a  code behind of your page and add some code to it. The code behind is a class that should inherit from System.Web.UI.Page

Kind regards,
Ivan Dimitrov
the Telerik team
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed