Skip to content

Type Method

custom(cacheControlHeader:ageHeader:)

A custom cache control policy that should be used for all files.
static func custom(cacheControlHeader: HTTPHeaders.CacheControl?, ageHeader: Int? = nil) -> FileMiddleware.CachePolicy

Parameters

cacheControlHeader

The Cache-Control header to use. If none is specified, any previous cache control header will be cleared.

ageHeader

The Age header to use, in seconds. If none is specified, any previous age header will be cleared.

Return Value

A cache policy with the specified headers.