cache_control

Crates.iocache_control
lib.rscache_control
version0.2.0
sourcesrc
created_at2018-06-15 20:46:40.700239
updated_at2021-10-18 15:53:38.032919
descriptionRust crate to parse the HTTP Cache-Control header.
homepage
repositoryhttps://github.com/connerebbinghaus/rust-cache-control
max_upload_size
id70286
size9,313
(connerebbinghaus)

documentation

README

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)));
Commit count: 10

cargo fmt