ResponseCacheFilter ResponseCacheFilter ResponseCacheFilter Class

Definition

A IPageFilter which sets the appropriate headers related to response caching.

public class ResponseCacheFilter : Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata, Microsoft.AspNetCore.Mvc.Filters.IPageFilter, Microsoft.AspNetCore.Mvc.Internal.IResponseCacheFilter
type ResponseCacheFilter = class
    interface IPageFilter
    interface IFilterMetadata
    interface IResponseCacheFilter
Public Class ResponseCacheFilter
Implements IFilterMetadata, IPageFilter, IResponseCacheFilter
Inheritance
ResponseCacheFilterResponseCacheFilterResponseCacheFilter
Implements

Constructors

ResponseCacheFilter(CacheProfile, ILoggerFactory) ResponseCacheFilter(CacheProfile, ILoggerFactory) ResponseCacheFilter(CacheProfile, ILoggerFactory)

Creates a new instance of ResponseCacheFilter

Properties

Duration Duration Duration

Gets or sets the duration in seconds for which the response is cached. This is a required parameter. This sets "max-age" in "Cache-control" header.

Location Location Location

Gets or sets the location where the data from a particular URL must be cached.

NoStore NoStore NoStore

Gets or sets the value which determines whether the data should be stored or not. When set to true, it sets "Cache-control" header to "no-store". Ignores the "Location" parameter for values other than "None". Ignores the "duration" parameter.

VaryByHeader VaryByHeader VaryByHeader

Gets or sets the value for the Vary response header.

VaryByQueryKeys VaryByQueryKeys VaryByQueryKeys

Gets or sets the query keys to vary by.

Methods

OnPageHandlerExecuted(PageHandlerExecutedContext) OnPageHandlerExecuted(PageHandlerExecutedContext) OnPageHandlerExecuted(PageHandlerExecutedContext)
OnPageHandlerExecuting(PageHandlerExecutingContext) OnPageHandlerExecuting(PageHandlerExecutingContext) OnPageHandlerExecuting(PageHandlerExecutingContext)
OnPageHandlerSelected(PageHandlerSelectedContext) OnPageHandlerSelected(PageHandlerSelectedContext) OnPageHandlerSelected(PageHandlerSelectedContext)

Applies to