Haio 0.2.X
Homebrew Asset IO/CDN
Loading...
Searching...
No Matches
Cache
Collaboration diagram for Cache:

keeping the answer, so the fetch and the conversion behind it happen once.

[cache]
ttl = 5000 # in seconds, since the entry was last wanted
max_usage = 50 # in mb, wherever the entries are kept
url = "redis://127.0.0.1:6379" # optional; without it, kept in this process

Cache Key

the md5 of the bucket, the path and the query, in the order written. the query is not sorted: it will spell a pipeline once filters chain, and a sorted key would serve one picture when another was asked for. the method is left out, so a HEAD finds what a GET stored.

Cache Where

url kept in bounded by
absent this process what it holds
file://dir one file per key what the files take
redis://host a shared redis an index haio keeps

a redis that cannot be reached reads as a miss: losing the cache costs latency and nothing else.

Cache Flow

deduplication is not part of caching. with no [cache] nothing is kept, and a burst on one key still reaches the producer once.