2 unstable releases

0.2.0 Oct 18, 2021
0.1.0 Jun 15, 2018

#82 in Caching

Download history 12086/week @ 2024-12-17 3729/week @ 2024-12-24 5070/week @ 2024-12-31 14772/week @ 2025-01-07 16346/week @ 2025-01-14 16310/week @ 2025-01-21 20870/week @ 2025-01-28 18412/week @ 2025-02-04 14629/week @ 2025-02-11 13983/week @ 2025-02-18 14320/week @ 2025-02-25 14931/week @ 2025-03-04 17177/week @ 2025-03-11 15749/week @ 2025-03-18 12524/week @ 2025-03-25 11345/week @ 2025-04-01

59,858 downloads per month
Used in 57 crates (18 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