Introduction

     

ASP.NET gives you the ability to cache the output of pages or portions of pages in memory to significantly improve performance. The main reason to cache is to reduce the latency and increase the scalability of an application while reducing the server resources required to deliver its page content. Latency is a measure of the time it takes for an application to respond to a user request. Scalability is the ability of an application to handle increased numbers of users. If a page is cached on the server, the rendered HTML stored in memory is served instead of a freshly generated page from the server. Because it takes less time for the client to get the page and display it, your web site will seem more responsive .

If pages are completely static, deciding to cache them is a no-brainer. But the decision gets trickier if pages must vary their content in response to one of the following:

  • Query string parameters

  • Client browser type (e.g., Internet Explorer, Netscape, and so on)

  • Custom parameters

Sometimes it makes sense to cache such pages, and sometimes not, as you will soon see.

ASP.NET also provides the ability to cache data items to enhance performance. But what if the data items occasionally change? Does it still make sense to cache them? The answer is a definite "yes," provided you know how to refresh the cache when the data changes.

The nuances of all of these topics are covered in the recipes that follow.



ASP. NET Cookbook
ASP.Net 2.0 Cookbook (Cookbooks (OReilly))
ISBN: 0596100647
EAN: 2147483647
Year: 2006
Pages: 179

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net