calternal_plugin::http_cache
Authorized conditional HTTP reads with strong representation ETags (#665).
Shared conditional HTTP reads for authenticated Plugin routes (#665; DESIGN §58).
Callers must authenticate and authorize before using this response helper.
It hashes the exact serialized representation, returns a strong ETag, and
answers a matching If-None-Match with an empty 304 response. API bodies
stay private, no-store; the web client’s bounded memory cache owns reuse.
Source: crates/calternal-plugin/src/http_cache.rs
Functions
Section titled “Functions”conditional_json
Section titled “conditional_json”pub fn conditional_json<T: Serialize>( headers: &HeaderMap, value: &T,) -> Result<Response, serde_json::Error>Serialize one JSON representation and apply the shared strong ETag contract.
The tag covers the exact JSON bytes sent below, including identity and path fields. The BLAKE3 hex alphabet makes the dynamic header value safe to build.