Explain < @OutputCache% > and the usage of VaryByParam, VaryByHeader ?



Explain < @OutputCache% > and the usage of VaryByParam, VaryByHeader ?..

Answer / arunendra shukla

OutputCache is used to control the caching policies of an ASP.NET page or user control. To cache a page @OutputCache directive should be defined as follows < %@ OutputCache Duration="100" VaryByParam="none" % >
VaryByParam: A semicolon-separated list of strings used to vary the output cache. By default, these strings correspond to a query string value sent with GET method attributes, or a parameter sent using the POST method. When this attribute is set to multiple parameters, the output cache contains a different version of the requested document for each specified parameter. Possible values include none, *, and any valid query string or POST parameter name.
VaryByHeader: A semicolon-separated list of HTTP headers used to vary the output cache. When this attribute is set to multiple headers, the output cache contains a different version of the requested document for each specified header.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More ASP.NET Interview Questions

Is it true that a Web service must be written in .NET or not?

0 Answers   Siebel,


Why SessionID changes in every request in asp.net?

0 Answers   HCL,


what is the generics and where used generics in your project?

3 Answers   CTC,


Define Query Interface,Adref,Release?

1 Answers   Microsoft,


What is the difference between Classic ASP and ASP.Net?

0 Answers  


What are the security types in ASP/ASP.NET? Different Authentication modes?

0 Answers  


How to kill more than one session variables at a time

9 Answers   iSoft,


What is webresource axd?

0 Answers  


Define session in asp.net.

0 Answers  


What is the use of @Register directives?

3 Answers  


What is class and object in asp.net?

0 Answers  


What are the contents of cookie?

0 Answers  


Categories