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

Explain the Order of events in an asp.net page?

0 Answers  


Whats an assembly

2 Answers   IBM,


Difference between asp and asp.net ?

4 Answers   Accenture, BirlaSoft, TCS,


What are the events that happen when a client requests an asp.net page from iis server?

0 Answers  


Which authentication uses a combination of windows and iis authentication?

0 Answers  






What are session state modes?

0 Answers  


What is AutoPostback?

0 Answers  


Why does my asp.net file have multiple tag with runat=server?

0 Answers  


What is view state and how it works in asp net?

0 Answers  


What are the advantages and limitations of query string?

0 Answers  


Explain the page lifecycle of an asp.net mvc? : asp.net mvc

0 Answers  


What do you mean by authentication and authorization

3 Answers  


Categories