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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What is session in asp.net?

688


What are the different properties of server control that exists?

761


What tags do you need to add within the asp:datagrid tags to bind columns manually? How?

722


Which protocol is used in a web api?

792


What are the two Layouts supported by a Web form in ASP.NET?

761


What is the difference between page.registerclientscriptblock and page.registerstartupscript?

640


What is the difference between stored procedure vs function?

765


What is the difference between rest and restful?

760


How to use ipostback?

772


What do you mean by serialize and marshalbyref?

754


How to disable validator control by client side JavaScript?

740


What are query strings used for?

718


Can you clarified A Web service can only be written in .NET or not?

749


which one is more flexibility and reliability and durability asp.net (VS)php which one is best and which one we do nice to create dynamic websites

1894


Can we use MSSql as backend in asp.net...if yes then How.?

773