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

How To Send Value one page to Another Page On MasterMenu Click ? please Tell Me!

3 Answers   Accenture,


How can I open ashx file in mobile?

0 Answers  


What is _viewstart?

0 Answers  


What are sessions and cookies?

0 Answers  


which type of data u send through request.querystring()?and tell abt exact size?

1 Answers   CSC, Nay Company,


Which template must you provide, in order to display data in a Repeater control?

3 Answers  


what are partial classes and their use?

3 Answers   Microsoft,


How to disable SOAP1.2 in Web Services?

1 Answers  


Can you explain page lifecycle in net?

0 Answers  


What is application in asp net?

0 Answers  


Can we have multiple web config files for an asp.net application?

0 Answers  


view state data is stored in which format?

15 Answers   Mind Tree, Pratham Software,


Categories