Skip to main content

Module cache

Module cache 

Source
Expand description

The ETag response cache: a trait, an in-memory implementation and a file-backed one.

Structs§

CachedResponse
A response the cache holds for a URL: the validator Fizzy sent with it, and the body it validates.
FileCache
Keeps cached responses on disk, the same layout the Go SDK uses: etags.json maps keys to validators and responses/<key>.body holds the bodies. Anything that goes wrong on disk is treated as a miss.
InMemoryCache
Keeps cached responses for the life of the process.

Traits§

ResponseCache
Stores JSON responses by ETag so a repeated read can be answered from a 304.

Functions§

cache_key
The key a URL is cached under. The credentials are folded in so one person’s cached reads are never answered to another.