OutputCacheProfile 類別提供以程式方式,存取和修改組態檔 caching 區段中 outputCacheProfiles 區段的 add 項目。
OutputCacheProfile 物件集中化常用的組態設定,例如,相依性、快取位置及快取過期時間,讓您不需在每個頁面上逐一指定。
使用 @ OutputCache 指示詞的 CacheProfile 屬性,可將 OutputCacheProfile 套用至頁面。
注意事項 |
|---|
| @ OutputCache 指示詞可以覆寫除了 Enabled 屬性以外,包含在 OutputCacheProfile 物件中的所有設定。這是為了啟用或停用 OutputCacheProfile,而不需要在可能將之覆寫的所有頁面中修改指示詞。 |
CacheDependency 類別會監視相依性,如此當任何快取項目變更時,該快取項目就會自動移除。