api

http4k / org.http4k.filter / CachingFilters / Response / FallbackCacheControl

FallbackCacheControl

object FallbackCacheControl

Applies the passed cache timings (Cache-Control, Expires, Vary) to responses, but only if they are not there already. Use this for adding default cache settings. By default, only applies when the status code of the response is < 400. This is overridable.

Functions

Name Summary
invoke operator fun invoke(clock: Clock, defaultCacheTimings: DefaultCacheTimings, predicate: (Response) -> Boolean = { it.status.code < 400 }): Filter