A high-performance, concurrent, content-addressable disk cache, with support for both sync and async APIs. 💩💵 but for your 🦀
Go to file
Kat Marchán fbeb6ec0ff
feat(license): Add in Patron license to make proprietary stuff more clear
2019-10-20 16:42:34 -04:00
.github build: switch to actions-rs (#12) 2019-10-19 11:05:53 -04:00
benches bench: add benchmarks for multiple reads 2019-10-18 00:33:48 -04:00
src feat(errors): Replace failure with anyhow crate (#17) 2019-10-20 00:25:28 -04:00
.clog.toml meta: added clog.toml and initial CHANGELOG 2019-07-01 13:32:47 -07:00
.gitignore meta: ignore .vscode 2019-05-25 22:59:24 -07:00
CHANGELOG.md docs: update changelog 2019-10-18 22:25:48 -04:00
CODE_OF_CONDUCT.md doc(readme): filled out README; added CoC and CONTRIBUTING.md 2019-07-01 00:04:52 -07:00
CONTRIBUTING.md doc(readme): filled out README; added CoC and CONTRIBUTING.md 2019-07-01 00:04:52 -07:00
Cargo.lock feat(errors): Replace failure with anyhow crate (#17) 2019-10-20 00:25:28 -04:00
Cargo.toml feat(errors): Replace failure with anyhow crate (#17) 2019-10-20 00:25:28 -04:00
LICENSE-APACHE.md feat(license): relicense to Parity+Apache 2019-10-15 12:15:34 -04:00
LICENSE-PARITY.md feat(license): relicense to Parity+Apache 2019-10-15 12:15:34 -04:00
LICENSE-PATRON.md feat(license): Add in Patron license to make proprietary stuff more clear 2019-10-20 16:42:34 -04:00
LICENSE.md feat(license): Add in Patron license to make proprietary stuff more clear 2019-10-20 16:42:34 -04:00
README.md feat(license): Add in Patron license to make proprietary stuff more clear 2019-10-20 16:42:34 -04:00

README.md

cacache

A high-performance, concurrent, content-addressable disk cache, optimized for async APIs.

Example

use cacache;
use async_attributes;

#[async_attributes::main]
async fn main() -> Result<(), cacache::Error> {
    let dir = String::from("./my-cache");

    // Write some data!
    cacache::put::data(&dir, "key", b"my-async-data").await?;

    // Get the data back!
    let data = cacache::get::data(&dir, "key").await?;
    assert_eq!(data, b"my-async-data");

    // Clean up the data!
    cacache::rm::all(&dir).await?;
}

Install

Using cargo-edit

$ cargo add cacache

Documentation

Features

  • First-class async support, using async-std as its runtime. Sync APIs are available but secondary.
  • Extraction by key or by content address (shasum, etc)
  • Subresource Integrity web standard support
  • Multi-hash support - safely host sha1, sha512, etc, in a single cache
  • Automatic content deduplication
  • Fault tolerance (immune to corruption, partial writes, process races, etc)
  • Consistency guarantees on read and write (full data verification)
  • Lockless, high-concurrency cache access
  • Large file support
  • Pretty darn fast
  • Arbitrary metadata storage
  • Punches nazis

Contributing

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!

License

This project is licensed under the Parity License. Third-party contributions are licensed under Apache-2.0 and belong to their respective authors.

The Parity License is a copyleft license that, unlike the GPL family, allows you to license derivative and connected works under permissive licenses like MIT or Apache-2.0. It's free to use provided the work you do is freely available!

For proprietary use, please contact me, or just sponsor me on GitHub under the appropriate tier to acquire a proprietary-use license! This funding model helps me make my work sustainable and compensates me for the work it took to write this crate!