From 7169e65244519dccfbea27770489902fbd245c63 Mon Sep 17 00:00:00 2001 From: liquidev Date: Sat, 23 Nov 2024 18:29:03 +0100 Subject: [PATCH] implement a blake3 content version layer for cache busting works pretty much the same as our previous `?cache` parameter, but is implemented in a less ad-hoc way --- Cargo.lock | 15 +++++ content/programming/opinions.tree | 2 +- crates/treehouse/Cargo.toml | 1 + crates/treehouse/src/main.rs | 4 +- crates/treehouse/src/vfs.rs | 2 + .../src/vfs/content_version_cache.rs | 62 +++++++++++++++++++ static/css/main.css | 4 +- 7 files changed, 86 insertions(+), 4 deletions(-) create mode 100644 crates/treehouse/src/vfs/content_version_cache.rs diff --git a/Cargo.lock b/Cargo.lock index 06748ae..80f5091 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -438,6 +438,20 @@ dependencies = [ "typenum", ] +[[package]] +name = "dashmap" +version = "6.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf" +dependencies = [ + "cfg-if", + "crossbeam-utils", + "hashbrown", + "lock_api", + "once_cell", + "parking_lot_core", +] + [[package]] name = "digest" version = "0.10.7" @@ -1583,6 +1597,7 @@ dependencies = [ "clap", "codespan-reporting", "copy_dir", + "dashmap", "env_logger", "git2", "handlebars", diff --git a/content/programming/opinions.tree b/content/programming/opinions.tree index b162359..a920ed5 100644 --- a/content/programming/opinions.tree +++ b/content/programming/opinions.tree @@ -6,7 +6,7 @@