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
What is session in asp.net?
What are the different properties of server control that exists?
What tags do you need to add within the asp:datagrid tags to bind columns manually? How?
Which protocol is used in a web api?
What are the two Layouts supported by a Web form in ASP.NET?
What is the difference between page.registerclientscriptblock and page.registerstartupscript?
What is the difference between stored procedure vs function?
What is the difference between rest and restful?
How to use ipostback?
What do you mean by serialize and marshalbyref?
How to disable validator control by client side JavaScript?
What are query strings used for?
Can you clarified A Web service can only be written in .NET or not?
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
Can we use MSSql as backend in asp.net...if yes then How.?