A high-performance, concurrent, content-addressable disk cache, with support for both sync and async APIs. 💩💵 but for your 🦀
See the codeA high-performance, concurrent, content-addressable disk cache, optimized for async APIs.
use cacache;
use async_attributes;
#[async_attributes::main]
async fn main() -> Result<(), cacache::Error> {
let dir = String::from("./my-cache");
// Write some data!
cacache::write(&dir, "key", b"my-async-data").await?;
// Get the data back!
let data = cacache::read(&dir, "key").await?;
assert_eq!(data, b"my-async-data");
// Clean up the data!
cacache::rm::all(&dir).await?;
}
Using cargo-edit
$ cargo add cacache
Minimum supported Rust version is 1.43.0.
async-std or
tokio as its runtime. Sync APIs are
available but secondary. You can also use sync APIs only and remove the
async runtime dependency.std::fs-style APImiette integration for detailed, helpful error reporting.async-std is the default async runtime. To use tokio instead, turn off
default features and enable the tokio-runtime feature, like this:
[dependencies]
cacache = { version = "*", default-features = false, features = ["tokio-runtime", "mmap"] }
You can also remove async APIs altogether, including removing async runtime dependency:
[dependencies]
cacache = { version = "*", default-features = false, features = ["mmap"] }
Experimental support for symlinking to existing files is provided via the "link_to" feature.
The cacache team enthusiastically welcomes contributions and project participation! There's a bunch of things you can do if you want to contribute! The Contributor Guide has all the information you need for everything from reporting bugs to contributing entire new features. Please don't hesitate to jump in if you'd like to, or even ask us questions if something isn't clear.
All participants and maintainers in this project are expected to follow Code of Conduct, and just generally be excellent to each other.
Happy hacking!
The Minimum Supported Rust Version for cacache is 1.67.0. Any changes to the
MSRV will be considered breaking changes.
This project is licensed under the Apache-2.0 License.
(top 24 of 34)
376 followers · starred Sep 2026
694 followers · starred Mar 2023
487 followers · starred Mar 2020
309 followers · starred Jun 2026
A high-performance, concurrent, content-addressable disk cache, with support for both sync and async APIs. 💩💵 but for your 🦀
See the codeA high-performance, concurrent, content-addressable disk cache, optimized for async APIs.
use cacache;
use async_attributes;
#[async_attributes::main]
async fn main() -> Result<(), cacache::Error> {
let dir = String::from("./my-cache");
// Write some data!
cacache::write(&dir, "key", b"my-async-data").await?;
// Get the data back!
let data = cacache::read(&dir, "key").await?;
assert_eq!(data, b"my-async-data");
// Clean up the data!
cacache::rm::all(&dir).await?;
}
Using cargo-edit
$ cargo add cacache
Minimum supported Rust version is 1.43.0.
async-std or
tokio as its runtime. Sync APIs are
available but secondary. You can also use sync APIs only and remove the
async runtime dependency.std::fs-style APImiette integration for detailed, helpful error reporting.async-std is the default async runtime. To use tokio instead, turn off
default features and enable the tokio-runtime feature, like this:
[dependencies]
cacache = { version = "*", default-features = false, features = ["tokio-runtime", "mmap"] }
You can also remove async APIs altogether, including removing async runtime dependency:
[dependencies]
cacache = { version = "*", default-features = false, features = ["mmap"] }
Experimental support for symlinking to existing files is provided via the "link_to" feature.
The cacache team enthusiastically welcomes contributions and project participation! There's a bunch of things you can do if you want to contribute! The Contributor Guide has all the information you need for everything from reporting bugs to contributing entire new features. Please don't hesitate to jump in if you'd like to, or even ask us questions if something isn't clear.
All participants and maintainers in this project are expected to follow Code of Conduct, and just generally be excellent to each other.
Happy hacking!
The Minimum Supported Rust Version for cacache is 1.67.0. Any changes to the
MSRV will be considered breaking changes.
This project is licensed under the Apache-2.0 License.
(top 24 of 34)
376 followers · starred Sep 2026
694 followers · starred Mar 2023
487 followers · starred Mar 2020
309 followers · starred Jun 2026