| Crates.io | bt_file_cache |
| lib.rs | bt_file_cache |
| version | 0.1.8 |
| created_at | 2025-11-06 22:05:33.793149+00 |
| updated_at | 2025-11-25 18:43:02.396119+00 |
| description | A caching mechanism for downloading and storing files from URLs |
| homepage | https://github.com/bachuetech/bt_file_cache |
| repository | https://github.com/bachuetech/bt_file_cache.git |
| max_upload_size | |
| id | 1920805 |
| size | 88,930 |
BT Cache
A caching mechanism for downloading and storing files from URLs. It generates SHA3-512 hashes of URLs to create unique file names and manages local storage of cached files.
let cache = BTCache::new(Some("myapp"))?;
let base64_data = cache.get_file_data_base64("https://bachuetech.biz/fake_image.png")?;
match cache.refresh_cache("https://bachuetech.biz/fake_image.png") {
Ok(file_path) => {
// Proceed with fetching and storing new content at file_path
println!("Cache refreshed. New content should be stored at: {}", file_path);
}
Err(e) => {
// Handle the error appropriately
eprintln!("Failed to refresh cache: {}", e);
}
}
GPL-3.0-only