How can you cache different version of same page using ASP. NET cache object?

 Posted by ArticlesMaint on 9/17/2009 | Category: ASP.NET Interview questions | Views: 6299


Output cache functionality is achieved by using “OutputCache” attribute on ASP. NET page header. Below is the syntax


<%@ Output Cache Duration="20" Location="Server" Vary By Param="state" Vary By Custom="minor version" Vary By Header="Accept-Language"%>


• Vary By Param: - Caches different version depending on input parameters send through HTTP POST/GET.
• Vary By Header: - Caches different version depending on the contents of the page header.
• Vary By Custom: -Lets you customize the way the cache handles page variations by declaring the attribute and overriding the Get Vary By Custom String handler.
• Vary By Control: -Caches different versions of a user control based on the value of properties of ASP objects in the control.


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response