OutputCachePolicyBuilder Class

Definition

Provides helper methods to create custom policies.

public sealed class OutputCachePolicyBuilder
type OutputCachePolicyBuilder = class
Public NotInheritable Class OutputCachePolicyBuilder
Inheritance
OutputCachePolicyBuilder

Methods

AddPolicy(Type)

Adds a dynamically resolved policy.

AddPolicy<T>()

Adds a dynamically resolved policy.

Cache()

Enables caching for the current request if not already enabled.

Expire(TimeSpan)

Adds a policy to change the cached response expiration.

NoCache()

Clears the policies and adds one preventing any caching logic to happen.

SetCacheKeyPrefix(Func<HttpContext,CancellationToken,ValueTask<String>>)

Adds a policy that varies the cache key using the specified value.

SetCacheKeyPrefix(Func<HttpContext,String>)

Adds a policy that varies the cache key using the specified value.

SetCacheKeyPrefix(String)

Adds a policy that varies the cache key using the specified value.

SetLocking(Boolean)

Adds a policy to change the request locking strategy.

SetVaryByHeader(String, String[])

Adds a policy to vary the cached responses by header.

SetVaryByHeader(String[])

Adds a policy to vary the cached responses by header.

SetVaryByHost(Boolean)

Adds a policy setting whether to vary by the Host header ot not.

SetVaryByQuery(String, String[])

Adds a policy to vary the cached responses by query strings.

SetVaryByQuery(String[])

Adds a policy to vary the cached responses by query strings.

SetVaryByRouteValue(String, String[])

Adds a policy to vary the cached responses by route value.

SetVaryByRouteValue(String[])

Adds a policy to vary the cached responses by route value.

Tag(String[])

Adds a policy to tag the cached response.

VaryByValue(Func<HttpContext,CancellationToken,ValueTask<KeyValuePair<String,String>>>)

Adds a policy that vary the cached content based on the specified value.

VaryByValue(Func<HttpContext,KeyValuePair<String,String>>)

Adds a policy to vary the cached responses by custom key/value.

VaryByValue(String, String)

Adds a policy to vary the cached responses by custom key/value.

With(Func<OutputCacheContext,Boolean>)

Adds a requirement to the current policy.

With(Func<OutputCacheContext,CancellationToken,ValueTask<Boolean>>)

Adds a requirement to the current policy.

Applies to