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

Take a Large textbox allow to type any data. Task 1:display the count of vowels in a lable on key press event of the textbox Task 2:dispaly count of dates in a lable when dates in following foramats:dd/mm/yy , mm/dd/yy , yy/mm/dd. Task3:compare 2 dates and display both are same or not which dates are in dd/mm/yy and mm/dd/yy farmats.

2593


What is the importance of aspnet_isapi.dll, inetinfo.exe andaspnet_wp.exe in the page loading process.

590


What is difference between view state and session state?

481


What is http request and response?

533


What is difference between viewstate and session state in javascript?

576






Describe briefly what is the role of IIS on an ASP.NET application? What does it for the same application?

565


Disable browser cache for entire ASP.NET website?

666


What is work flow gen? how can it will work with .Net?

2576


What is the difference between runtime version and version?

507


What kind of data can be stored in viewstate?

530


What tags do you need to add within the asp:datagrid tags to bind columns manually? Give an example.

601


Will the asp.net validators run in server side or client side? How do you do client-side validation in .net? How to disable validator control by client side javascript?

527


I have an excel file with data, i am importing this excel file data into Sqlserver 2005 database. while importing i am getting wrong data(ie, special characters) in one column(description column), upto some limit the data in that column is coming fine,after that data is coming like below. The "Walter" leather storage bench is one of our most popular styles. The top with the tufting and double stitching finish a very impressive piece. The size is perfect in front of beds and the storage adds another functional bonus. Open it up and sneak al���Ƴ�Â��ƴ�Ã��ƶ�Å�� al���Ƴ�Â��ƴ�Ã��ƶ�Å�� Is there anywhy to resolve this? (I am using recordset in coding for developing import process.) please help me soon.

1429


What are the 3 levels at which content pages can be attached to Master Page?

583


Can more than one person use the same login?

570