CacheOptions

public struct CacheOptions

Cache configuration options for StaticFileServer.

  • Initialize a CacheOptions instance.

    Parameter

    Parameter addLastModifiedHeader: an indication whether to set Last-Modified header in the response.

    Parameter

    Parameter maxAgeCacheControlHeader: a max-age in milliseconds for max-age value in Cache-Control header in the response

    Parameter

    Parameter generateETag: an indication whether to set Etag header in the response.

    Declaration

    Swift

    public init(addLastModifiedHeader: Bool = true, maxAgeCacheControlHeader: Int = 0,
                 generateETag: Bool = true)

    Parameters

    addLastModifiedHeader

    an indication whether to set “Last-Modified” header in the response.

    maxAgeCacheControlHeader

    a max-age in milliseconds for “max-age” value in “Cache-Control” header in the response

    generateETag

    an indication whether to set “Etag” header in the response.