ResponseCacheAttribute 類別

定義

指定在回應快取中設定適當標頭所需的參數。

public ref class ResponseCacheAttribute : Attribute, Microsoft::AspNetCore::Mvc::Filters::IFilterFactory, Microsoft::AspNetCore::Mvc::Filters::IOrderedFilter
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=false, Inherited=true)]
public class ResponseCacheAttribute : Attribute, Microsoft.AspNetCore.Mvc.Filters.IFilterFactory, Microsoft.AspNetCore.Mvc.Filters.IOrderedFilter
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=false, Inherited=true)>]
type ResponseCacheAttribute = class
    inherit Attribute
    interface IFilterFactory
    interface IFilterMetadata
    interface IOrderedFilter
Public Class ResponseCacheAttribute
Inherits Attribute
Implements IFilterFactory, IOrderedFilter
繼承
ResponseCacheAttribute
屬性
實作

建構函式

ResponseCacheAttribute()

指定在回應快取中設定適當標頭所需的參數。

屬性

CacheProfileName

取得或設定快取設定檔名稱的值。

Duration

取得或設定快取回應的持續時間,以秒為單位。 這會設定 「Cache-control」 標頭中的 「max-age」。

IsReusable

取得值,這個值表示 是否可以跨要求重複使用 的結果 CreateInstance(IServiceProvider)

Location

取得或設定必須快取來自特定 URL 之資料的位置。

NoStore

取得或設定值,這個值會決定是否應該儲存資料。 當設定為 true 時,會將 「Cache-control」 標頭設定為 「no-store」。 忽略 「None」 以外的值的 「Location」 參數。 忽略 「duration」 參數。

Order

取得決定篩選準則執行順序的順序值。 篩選會以屬性的 Order 遞增數值執行。

VaryByHeader

取得或設定 Vary 回應標頭的值。

VaryByQueryKeys

取得或設定要變更的查詢索引鍵。

方法

CreateInstance(IServiceProvider)

建立可執行篩選準則的實例。

GetCacheProfile(MvcOptions)

CacheProfile取得這個屬性的 。

適用於