Skip to main content

Crate next_rust_cache

Crate next_rust_cache 

Source
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.
CacheEntry
A cached value with freshness information.
CacheKey
Cache key. Namespaces used by the framework: page:<path>, data:<key>, image:<hash>.
CacheOptions
Options for Cache::get_or_insert_json.
FileStore
Persistent store: one <hash>.bin (value) and <hash>.json (metadata) pair per key. Writes are atomic (write to a temp file, then rename).
MemoryStore
Bounded in-memory LRU store.

Enums§

CacheError

Traits§

CacheStore
Storage backend.

Functions§

cache
Memoize f in 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 false if one was already installed.
invalidate
Remove a data-cache entry.
revalidate_path
Re-render path on its next request.
revalidate_tag
Invalidate all entries tagged tag.

Type Aliases§

BoxFuture