cachingProhibited
Passes only requests that explicitly forbid caching with a Cache-Control header with either a no-cache or max-age=0 setting.
Signature
def cachingProhibited: Directive0
Description
This directive is used to filter out requests that forbid caching. It is used as a building block of the cache directive to prevent caching if the client requests so.
Note
Caching directives are not automatically in scope, see Usage about how to enable them.
Example
val route =
cachingProhibited {
complete("abc")
}
Get("/") ~> route ~> check {
handled === false
}
Get("/") ~> `Cache-Control`(CacheDirectives.`no-cache`) ~> route ~> check {
responseAs[String] === "abc"
}