Page Output Caching

 

Let’s consider a base example and then examine in a little detail the additional parameters available to us programmers. To minimally enable caching for a web forms page (or user controls) you can use either of the following:

1. Declarative specification via the @OutputCache directive e.g.:

<%@ OutputCache Duration="120" VaryByParam="none" %>

2. Programmatic specification via the Cache property of the HttpResponse class, e.g.:

Response.Cache.SetExpires(datetime,now,addminutes(2))
Response.Cache.SetCacheability(HttpCacheability.Public)

posted on 2004-02-17 10:42  郭岩  阅读(684)  评论(0编辑  收藏  举报