17 releases (7 breaking)

Uses new Rust 2021

0.7.0 Jun 17, 2022
0.6.1 Mar 29, 2022
0.0.0 Sep 1, 2018

#14 in Caching

Download history 91/week @ 2022-03-10 168/week @ 2022-03-17 170/week @ 2022-03-24 431/week @ 2022-03-31 1070/week @ 2022-04-07 426/week @ 2022-04-14 254/week @ 2022-04-21 389/week @ 2022-04-28 218/week @ 2022-05-05 364/week @ 2022-05-12 282/week @ 2022-05-19 305/week @ 2022-05-26 657/week @ 2022-06-02 130/week @ 2022-06-09 181/week @ 2022-06-16 276/week @ 2022-06-23

1,314 downloads per month
Used in 4 crates (2 directly)


587 lines


CI Crates.io Docs.rs Codecov Crates.io

the http-cache logo

A caching middleware that follows HTTP caching rules, thanks to http-cache-semantics. By default, it uses cacache as the backend cache manager.

How do I use this?

Likely you won't! At least not directly. Unless you are looking to implement a custom backend cache manager or client middleware you'll probably want to pull in one of the existing client implementations instead. See the Provided Client Implementations section below.

Minimum Supported Rust Version (MSRV)



With cargo add installed :

cargo add http-cache


The following features are available. By default manager-cacache is enabled.

  • manager-cacache (default): enable cacache, a high-performance disk cache, backend manager.
  • manager-moka (disabled): enable moka, a high-performance in-memory cache, backend manager.
  • with-http-types (disabled): enable http-types type conversion support


Provided Client Implementations

  • Surf: See README for more details
  • Reqwest: See README for more details


Licensed under either of

at your option.


Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.


~235K SLoC