(wrap-cache-headers cacheable-uris
{:keys [max-age s-maxage] :as options}
handler)Wraps the handler with a middleware which sets the value of Cache-Control
header with directives based on options parameter.
You can set either :max-age (defaults to 30) or :s-maxage (no default).
If both are provided, only s-maxage is applied (shared caches are supposed
to ignore s-maxage if both are present).
The middleware is applied only if:
cacheable-uris parameterOtherwise, directives no-cache, no-store, must-revalidate are set.
Wraps the handler with a middleware which sets the value of `Cache-Control` header with directives based on `options` parameter. You can set either `:max-age` (defaults to 30) or `:s-maxage` (no default). If both are provided, only s-maxage is applied (shared caches are supposed to ignore s-maxage if both are present). The middleware is applied only if: - the handler returns status code 404, or - the request path matches one of the patterns listed in `cacheable-uris` parameter Otherwise, directives `no-cache, no-store, must-revalidate` are set.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |