Crate tower_cache_control

Source
Expand description

Tower layer that simplify setting Cache-Control response header, featuring:

  • Opinionated Cache-Control value based on the response status
  • Customizable default value

§Installation

[dependencies]
tower-cache-control = "1.0.0"

§Usage

Layer CacheControlLayer comes with a default value (via Default trait), although it supports a custom CacheControl setting (via axum-extra crate re-export).

Structs§

CacheControl
Cache-Control header, defined in RFC7234 with extensions in RFC8246
CacheControlLayer
Middleware Layer for the CacheControlService service.
CacheControlService
Cache-Control setter Service.