A simple cache-to-disk mechanism
This crate provides a simple, zero-configuration, mechanism for caching data both in-memory and to disk.
A typical usecase is an application that needs to deal with long-running queries to the web or to a database. If the application fails for some reason or if it is a command-line application, the cache will let the application resume its next run from where it stopped.
Example
extern crate remember_this;
extern crate tokio;
use *;
async
A few notes and features
- Individual caches can have a format version number. This way, if your data format has changed in subtle ways, by increasing the version number, you can be sure that you're not going to read "wrong" data from the disk.
- The storage format is flexbuffers on sled. This gives us a degree of dynamic typing while we load from disk, which decreases the chances of your application accidentally reading from an incorrect version of your format.
TODO
- For the moment, the on-disk LRU is not updated when data is fetched from memory.