How to do Caching in ASP?



How to do Caching in ASP?..

Answer / p.ramakrishna

<%@ OutputCache Duration="60" VaryByParam="None" %>
VaryByParam value

Description

none :One version of page cached (only raw GET)
*: n versions of page cached based on query string and/or
POST body
v1: n versions of page cached based on value of v1 variable
in query string or POST body
v1;v2: n versions of page cached based on value of v1 and
v2 variables in query string or POST body


<%@ OutputCache Duration="60" VaryByParam="none" %>
<%@ OutputCache Duration="60" VaryByParam="*" %>
<%@ OutputCache Duration="60" VaryByParam="name;age" %>
The OutputCache directive supports several other cache
varying options

* VaryByHeader - maintain separate cache entry for
header string changes (UserAgent, UserLanguage, etc.)
* VaryByControl - for user controls, maintain separate
cache entry for properties of a user control
* VaryByCustom - can specify separate cache entries for
browser types and version or provide a custom
GetVaryByCustomString method in HttpApplicationderived class

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More ASP.NET Interview Questions

Give me one example of Web API Routing?

0 Answers  


what is purpose of xml control in standard controls of asp.net

1 Answers  


Could u send me the answer for this question as soon as possible. Im using 'System.net.mail.mailmessage' namespace for sending a mail from my application. What should I mention in 'system.net.mail.mailmessage.to' property and What should I mention in 'system.net.mail.mailmessage.from' property.

1 Answers  


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

0 Answers  


what is soap?

5 Answers   Cognizant, Microsoft, NCR,






What are the different modes for the sessionstates in the web.config file?

2 Answers  


Differnce between Control an View State

1 Answers   Proteans,


What is asp.net version?

0 Answers  


What is the difference between ASP and ASP.NET?

4 Answers   Sans Pareil IT Services, TCS,


What is the difference between Server.Transfer and Response.Redirect? Why would I choose one over the other?

8 Answers   Siebel Systems,


What’s the catch?

0 Answers  


What is data caching?

0 Answers  


Categories