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

Explain page output caching?

0 Answers  


Error : The operation couldn’t be performed because ole db provider sqlncli10 for linked server was unable to begin a distributed transaction.00000110 oledb provider for linked server returned message the partner transaction manager has disabled its support for remote/network transactions. I can able to execute the stored procedure in sql server but when i run the web page getting error like above. I did all the configuration. what is the solution?

0 Answers  


How can you use a custom controls in ASP.NET application?

0 Answers   Sans Pareil IT Services,


Define static constructor?

0 Answers  


What is the mvc model?

0 Answers  


What are uri parameters?

0 Answers  


What is dataset and uses of dataset ?

6 Answers   HCL, TCS,


When maintaining session through Sql server, what is the impact of Read and Write operation on Session objects? will performance degrade..

3 Answers   Allsec Technologies,


How do you relate an aspx page with its code behind page ?

4 Answers   Accenture, BirlaSoft,


what are webservices?In which circumstances we can go for webservices?

3 Answers   Microsoft,


Which method is used to force all the validation controls to run?

0 Answers  


If cookies is disabled in client browser will session work ?

7 Answers   Satyam,


Categories