We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Platform : ASP.NET
|
Category : Output Caching

How can I set a page/control to be cached only for certain parameters

Let’s say you set your output cache directive as follows: VaryByCustom - is a string that your application has to interpret in the GetVaryByCustomString override in the gloabal.asax file.
Now, to avoid caching pages for certain ProductIDs you can set the cacheability to private or nocache from your page load for those pages as follows:

VB.NET C#

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.