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

Define Query Interface,Adref,Release?

1 Answers   Microsoft,


What are the file extensions for razor views?

0 Answers   NA,


Can you use Web API with ASP.NET Web Form?

0 Answers  


Do cookies store passwords?

0 Answers  


What is ispostback method in asp.net? Why do we use that?

0 Answers  


How can you handle exceptions in asp.net?

0 Answers  


what is silverlight and what is the purpose of silverlight?

2 Answers   Cognizant, CTS,


Explain what is clr?

0 Answers  


What are the disadvantages of view state / what are the benefits?

2 Answers   Siebel Systems,


What is class and object in asp.net?

0 Answers  


Explain the difference between asp.net mvc and asp.net webforms

0 Answers  


Explain the Session state management options available with ASP.NET?

0 Answers   Siebel,


Categories