Expand description
Cache abstraction used for incremental static regeneration (ISR), the data cache and optimized assets.
CacheStore– the storage trait. Implement it to plug in Redis, Memcached, a CDN KV store, … The framework never requires Redis.MemoryStore– bounded in-memory LRU store (default).FileStore– persistent store on local disk.Cache– typed convenience API over any store.
Structs§
- Cache
- Typed cache API over a shared store.
- Cache
Entry - A cached value with freshness information.
- Cache
Key - Cache key. Namespaces used by the framework:
page:<path>,data:<key>,image:<hash>. - Cache
Options - Options for
Cache::get_or_insert_json. - File
Store - Persistent store: one
<hash>.bin(value) and<hash>.json(metadata) pair per key. Writes are atomic (write to a temp file, then rename). - Memory
Store - Bounded in-memory LRU store.
Enums§
Traits§
- Cache
Store - Storage backend.
Functions§
- cache
- Memoize
fin the global data cache. - global
- The process-wide cache (an in-memory default if none was installed).
- install_
global - Install the process-wide cache (done by the server at startup).
Returns
falseif one was already installed. - invalidate
- Remove a data-cache entry.
- revalidate_
path - Re-render
pathon its next request. - revalidate_
tag - Invalidate all entries tagged
tag.