Skip to main content

cache_key

Function cache_key 

Source
pub fn cache_key(
    method: &str,
    url: &str,
    origin: &str,
    key_id: Option<&str>,
) -> String
Expand description

The cache key of a request: lowercase hex SHA-256 over the method, the normalized URL, and a digest of the origin and the API key id (never the secret). Requests from different keys, or to different origins, never share an entry.

url should already be normalized: lowercase scheme and host, default port removed, no fragment, no userinfo. The query is part of the key verbatim.