What is the significance of duration attribute of @OutputCache page directive ?

 Posted by Akiii on 5/19/2012 | Category: ASP.NET Interview questions | Views: 3134 | Points: 40

<%@OutputCache Duration="120" %>

In the above, the duration for the output cache of the page is 120 seconds. That means the page is cached for 120 seconds; the server loads the response in memory and retains that response for 120 seconds. Any requests during that time receive the cached response. When the cache duration expires, the next request generates a new response and cached for another 120 seconds.

Caching can be an overhead or a blessing in disguise. It is better to use them wisely !

Thanks and Regards

| Alert Moderator 

Comments or Responses

Login to post response