1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//! HTTP cache for trillium implementing [RFC 9111] semantics, in two handler forms that
//! share one caching engine.
//!
//! The primary form is a [`trillium-client`](https://docs.rs/trillium-client) handler,
//! provided by the `client` module behind the `client` feature. Mount it on the client a
//! [`trillium-proxy`](https://docs.rs/trillium-proxy) uses to reach its upstream, mark it
//! shared, and the proxy becomes a CDN-style shared cache in front of that origin. On any
//! other `trillium-client` it serves as a user-agent cache.
//!
//! The server form, [`Cache`], sits before a trillium handler and caches that handler's own
//! responses.
//!
//! See the `client` module to get started, or [`Cache::new`] for the server form.
//!
//! ## Features
//!
//! - `client` — the `trillium-client` handler form (the `client` module), for caching at the
//! user-agent layer and as a proxy's shared upstream cache.
//!
//! ## 0.1 status
//!
//! The server cache implements the bulk of RFC 9111: storability, freshness, conditional
//! revalidation, `Vary`, unsafe-method invalidation, plus `stale-if-error` recovery from
//! [RFC 5861]. The `stale-while-revalidate` directive is parsed but treated as synchronous
//! revalidation in this release. The client handler supports the full set including
//! background `stale-while-revalidate`.
//!
//! [RFC 9111]: https://www.rfc-editor.org/rfc/rfc9111
//! [RFC 5861]: https://www.rfc-editor.org/rfc/rfc5861
pub use ;
pub use ;
pub use Cache;
pub use ;