2 unstable releases

0.2.0 Oct 18, 2021
0.1.0 Jun 15, 2018

#132 in Caching

Download history 130698/week @ 2025-08-25 102472/week @ 2025-09-01 138235/week @ 2025-09-08 137707/week @ 2025-09-15 160587/week @ 2025-09-22 169486/week @ 2025-09-29 132074/week @ 2025-10-06 111626/week @ 2025-10-13 129526/week @ 2025-10-20 154579/week @ 2025-10-27 162344/week @ 2025-11-03 149057/week @ 2025-11-10 150407/week @ 2025-11-17 81155/week @ 2025-11-24 47984/week @ 2025-12-01 45227/week @ 2025-12-08

331,384 downloads per month
Used in 61 crates (19 directly)

MIT license

10KB
155 lines

rust-cache-control

Rust crate to parse the HTTP Cache-Control header.

use cache_control::{Cachability, CacheControl};
use std::time::Duration;

let cache_control = CacheControl::from_header("Cache-Control: public, max-age=60").unwrap();
assert_eq!(cache_control.cachability, Some(Cachability::Public));
assert_eq!(cache_control.max_age, Some(Duration::from_secs(60)));

No runtime deps