web-static-pack-common 0.5.2

Common types for web-static-pack and web-static-pack-packer crates.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! Cache control types used by file.

use rkyv::{Archive, Serialize};

/// Type representing cache control of a file. This will correspond to
/// `cache-control` header set in http response.
#[derive(Archive, Serialize, Clone, Copy, PartialEq, Eq, Debug)]
#[rkyv(archived = CacheControlArchived)]
#[rkyv(derive(Clone, Copy, PartialEq, Eq, Debug))]
pub enum CacheControl {
    /// No caching. This corresponds to "cache never" strategy, ex. by setting
    /// `no-cache` header value.
    NoCache,
    /// Max caching. This corresponds to "cache forever" strategy, ex. by
    /// setting `max-age=31536000, immutable` header value.
    MaxCache,
}