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

What are different templates available in Repeater,DataList and Datagrid ?

1 Answers  


where is declare global variable in asp.net and what is use of global variable

3 Answers  


1.can we add connection string in global.asax?????????? 2.what are the default files included when we create new web application????

7 Answers   Sparsh,


Is post back in asp.net?

0 Answers  


Explain the server control events of asp.net ?

0 Answers  






Project Architecture (3tier, n-tier)

1 Answers   Syntel,


difference between <connectionstring> <Appsetting>

6 Answers   VebTel,


what is uncle aunty file

1 Answers  


What's a bubbled event?

3 Answers   Siebel,


How can you handle errors in Web API?

0 Answers  


Which two new properties are added in asp.net 4.0 page class?

0 Answers  


Explain diff. Between friend and protected friend?

0 Answers  


Categories