CacheProfile Class

Summary

Defines a set of settings which can be used for response caching.

Syntax

public class CacheProfile

GitHub

View on GitHub

class Microsoft.AspNet.Mvc.CacheProfile

Properties

Duration()

Gets or sets the duration in seconds for which the response is cached. If this property is set to a non null value, the “max-age” in “Cache-control” header is set in the @!:Microsoft.AspNet.Http.HttpContext.Response-.

Return type:System.Nullable{System.Int32}
public int ? Duration { get; set; }
Location()

Gets or sets the location where the data from a particular URL must be cached. If this property is set to a non null value, the “Cache-control” header is set in the @!:Microsoft.AspNet.Http.HttpContext.Response-.

Return type:System.Nullable{Microsoft.AspNet.Mvc.ResponseCacheLocation}
public ResponseCacheLocation? Location { get; set; }
NoStore()

Gets or sets the value which determines whether the data should be stored or not. When set to <see langword=”true” />, it sets “Cache-control” header in @!:Microsoft.AspNet.Http.HttpContext.Response- to “no-store”. Ignores the “Location” parameter for values other than “None”. Ignores the “Duration” parameter.

Return type:System.Nullable{System.Boolean}
public bool ? NoStore { get; set; }
VaryByHeader()

Gets or sets the value for the Vary header in @!:Microsoft.AspNet.Http.HttpContext.Response-.

Return type:System.String
public string VaryByHeader { get; set; }