Sams Teach Yourself ASP.NET in 21 Days, Second Edition
By Chris Payne
Table of Contents
Day 14.  Using ASP.NET's Improved Caching Capabilities

Today you learned about ASP.NET's extensive caching features, many of which are performed automatically. For example, ASP.NET automatically caches application settings and your compiled ASP.NET Web pages.

You also looked at caching the output of an ASP.NET Web page on the Web server. Part of the power of ASP.NET is the easy output caching. Simply use the <%@ OutputCache %> directive and specify a duration.

In addition to full-page output caching, you can implement fragment caching, which is the caching of specific user controls within an ASP.NET Web page.

The Cache object allows easy storage and retrieval of objects from the cache. The Add and Insert methods allow you to specify a cache's priority, the expiration time, and any dependencies. Dependencies allow a cache to base the validity of its contents on other items, such as files, directories, or other items in cache.

The HttpCachePolicy class, available through the Response.Cache object, allows further control of the caching mechanism. You can use the VaryByHeaders property to specify how pages should be cached when additional data is available, such as from querystrings or form submissions.

You've reached the end of another week! Next week will cover advanced ASP.NET application concepts, including Web services and configuration. These concepts will round out your ASP.NET skills, enabling you to tackle any ASP.NET situation. Be sure to check out the bonus project first!


    Sams Teach Yourself ASP. NET in 21 Days
    Sams Teach Yourself ASP.NET in 21 Days (2nd Edition)
    ISBN: 0672324458
    EAN: 2147483647
    Year: 2003
    Pages: 307
    Authors: Chris Payne © 2008-2017.
    If you may any questions please contact us: