欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

asp.net 頁面輸出緩存

 更新時間:2010年02月26日 15:55:54   作者:  
最簡單的緩存機制,把整個Aspx頁面保存在服務器端內存中,用戶請求頁面時,直接從服務器端內存中提取數數據,不在經歷頁面的生命周期。
主要用于不經常更新和修改,而在第一次編譯是時要經過大量處理的數據。頁面輸出緩存是緩存的整個頁面
使用很簡單<%@ OutPutCache Duration="60" VaryByParam="none"%>
Duration:緩存時間
VaryByParam:通過參數來更新緩存的內容
還有其他的一些屬性
CacheProfile:調用WebConfig中的緩存時間
例如:WebCofig中
復制代碼 代碼如下:

<system.web>
<outputCacheSetting>
<outputCacheProfiles>
<add name="cacheTest" duration="50"/>
<outputCacheProfiles>
</outputCahceSetting>
</system.web>

在頁面中聲明
<%@ OutputCache CacheProfile="cacheTest" VaryByParam="none"%>
VaryByControl:通過控件來改變緩存
<%@OutputCache Duration="60" VaryByParam="none" VaryByControl="Button1"%>

相關文章

最新評論