cache_control 0.2.0

Rust crate to parse the HTTP Cache-Control header.
Documentation
  • Coverage
  • 94.74%
    18 out of 19 items documented2 out of 5 items with examples
  • Size
  • Source code size: 8.94 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.66 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 10s Average build duration of successful builds.
  • all releases: 10s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • connerebbinghaus/rust-cache-control
    2 3 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • connerebbinghaus

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)));