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

What method must be overridden in a custom control? a) The Paint() method b) The Control_Build() method c) The Render() method d) The default constructor

1 Answers   Icertis, Microsoft, Syntax Softtech,


From which base class all web forms are inherited?

0 Answers  


When during the page processing cycle is ViewState available?

1 Answers  


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

3 Answers   Accenture,


What are the major differences between asp.net1.1 and asp.net 2.0?

8 Answers   CTS, Deloitte, Mphasis, Vison,






Caching techniques in .NET?

2 Answers   Microsoft,


What is difference between asp.net and asp?

0 Answers  


code for inserting images into gridview colomns from database

3 Answers   HP,


What is active web page?

0 Answers  


Any one can tell how we store tiff format images in database and retrive from the database(need for tiff format only)

0 Answers   Tricom,


Will session work if cookies is disabled?

0 Answers  


What is the purpose of asp.net?

0 Answers  


Categories