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 publisher?

1737


How do I publish my asp.net application to my isp's web server?

683


Is asp.net a programming language?

625


If I have more than one version of one assemblies, then how will I use old version (how/where to specify version number?) In my application?

620


What are the features of asp.net mvc?

603






What's the use of formatters in .net?

646


How can you implement encapsulation in asp.net?

11690


Explain what is an assembly?

643


Explain the difference between web user control and web custom control?

608


if i want to give an alert message like "try after sometime" to a web page which is being seen by other person.if a web page is not seen by anyone then it should display otherwise it show a display a message stating that other person is viewing so try after some time........how can i implement this.

1928


What is side-by-side execution? Can two applications, one using a private assembly and other using a shared assembly, be stated as side-by-side executables?

661


What are the contents of cookie?

672


What is aspect-oriented programming?

629


What is autopostback in asp net?

676


How asynchronous call can be implemented using delegates?

647