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

When you are running a component within ASP.NET, what process is it running within on Windows XP? Windows 2000? Windows 2003?

0 Answers   BirlaSoft,


True or False: A Web service can only be written in .NET?

5 Answers  


Explain autherization levels in .net ?

2 Answers  


What are the various ways of securing a web site that could prevent from hacking etc ?

1 Answers  


Differentiate between early binding and late binding.

0 Answers  






Which is the parent class of the web server control?

0 Answers  


How to use multiple scriptmanager controls in a web page?

0 Answers  


From the given paragraph of text, write a program to match the strings of format “Any number of numerals followed by an underscore followed by any number of alphabets" ex:123_abc (Note:using regular expressions)

4 Answers   Microsoft,


Why do we need a web application session?

0 Answers  


Any one can tell how we store tiff format images in database and retrive from the database(need for tiff format only)

0 Answers   Tricom,


What is asp.net master page?

0 Answers  


What are sql notifications and sql invalidations?

0 Answers  


Categories