ASP.NET output cache demo (CSASPNETOutputCache)

This VC# sample demonstrates the usage of OutputCache in ASP.NET

C# (56.0 KB)
 
 
 
 
 
(0)
12,964 times
Add to favorites
5/5/2011
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question


  • Caching Profile
    2 Posts | Last post August 03, 2011
    • Can any one explain in brief what is the role of caching profile in output caching.
    • Hi,
      Output cache profile is used to provide different predefined cache strategies. For exmaple, you can change all cache time for a specified group of pages to another without change duration in every page(because you only need to change the duration of the certain profile in web.config)
      For definition(in web.config):
      <caching>
        <outputCacheSettings>
          <outputCacheProfiles>
            <add name="Cache30Seconds" duration="30" 
              varyByParam="none" />
          </outputCacheProfiles>
        </outputCacheSettings>
      </caching>
      For usage(in page head):
      <%@ OutputCache CacheProfile="Cache30Seconds" %>
      For more details:
      http://msdn.microsoft.com/en-us/library/zd1ysf1y.aspx
      http://msdn.microsoft.com/en-us/library/hdxfb6cy.aspx
      I hope this can be helpful.