2 unstable releases

0.2.0 Oct 18, 2021
0.1.0 Jun 15, 2018

#69 in Caching

Download history 17181/week @ 2024-12-09 12979/week @ 2024-12-16 4367/week @ 2024-12-23 4494/week @ 2024-12-30 12505/week @ 2025-01-06 17545/week @ 2025-01-13 14899/week @ 2025-01-20 21704/week @ 2025-01-27 17661/week @ 2025-02-03 16474/week @ 2025-02-10 12804/week @ 2025-02-17 14593/week @ 2025-02-24 14733/week @ 2025-03-03 17500/week @ 2025-03-10 15960/week @ 2025-03-17 12294/week @ 2025-03-24

60,823 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