web_static_pack_common/cache_control.rs
1//! Cache control types used by file.
2
3use rkyv::{Archive, Serialize};
4
5/// Type representing cache control of a file. This will correspond to
6/// `cache-control` header set in http response.
7#[derive(Archive, Serialize, Clone, Copy, PartialEq, Eq, Debug)]
8#[rkyv(archived = CacheControlArchived)]
9#[rkyv(derive(Clone, Copy, PartialEq, Eq, Debug))]
10pub enum CacheControl {
11 /// No caching. This corresponds to "cache never" strategy, ex. by setting
12 /// `no-cache` header value.
13 NoCache,
14 /// Max caching. This corresponds to "cache forever" strategy, ex. by
15 /// setting `max-age=31536000, immutable` header value.
16 MaxCache,
17}