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 setting must be added in the configuration file to deny a particular user from accessing the secured resources?
What are the advantages of asp.net mvc framework? : asp.net mvc
Explain the difference between webfarm and webgardens in .net?
What is application Object?
Explain how caching in asp.net 2.0 is different from caching in asp.net 1.1?
What is difference between datalist and gridview?
What is Model-View-View Model?
Why session is necessary in web application?
In your ASP.NET 2.0 web application you want to display an image that is selected from a collection of images. What approach will you use to implementing this?
Contrast oop and soa. What are tenets of each16. How does the xmlserializer work? What acl permissions does a process using it require?
What is the difference between a page theme and a global theme?
What is clickid?
State differences between MVC and WebAPI
How can we register exception filter globally?
How to display Alert in ASP.NET