2 unstable releases

0.2.0 Oct 18, 2021
0.1.0 Jun 15, 2018

#205 in Caching

Download history 49973/week @ 2026-01-10 32063/week @ 2026-01-17 30288/week @ 2026-01-24 48390/week @ 2026-01-31 61513/week @ 2026-02-07 59124/week @ 2026-02-14 69623/week @ 2026-02-21 68303/week @ 2026-02-28 88830/week @ 2026-03-07 71082/week @ 2026-03-14 67235/week @ 2026-03-21 68674/week @ 2026-03-28 59743/week @ 2026-04-04 64465/week @ 2026-04-11 60889/week @ 2026-04-18 68867/week @ 2026-04-25

264,713 downloads per month
Used in 68 crates (20 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