Cache/Library.rs
1#![allow(
2 non_snake_case,
3 non_camel_case_types,
4 non_upper_case_globals,
5 dead_code,
6 unused_imports,
7 unused_variables,
8 unused_assignments
9)]
10
11//! # Cache 📦 - process-wide caching primitives for Land 🏞️
12//!
13//! Two independent caches that the Tauri host (Mountain) and any other
14//! Land embedder share:
15//!
16//! - [`AssetMemoryMap`] - file-backed mmap cache for bundled static assets. The
17//! bundled workbench under `Element/Sky/Target/Static/Application/` is ~80
18//! MB; per-request `fs::read` pays a syscall + alloc + memcpy on every fetch,
19//! whereas `memmap2::Mmap` hands the webview a borrowed slice of file-backed
20//! pages the OS can evict under pressure. Optional `<file>.br` siblings are
21//! picked up transparently for `Content-Encoding: br`.
22//! - [`PathCanon`] - process-wide canonical-path cache. Collapses repeated
23//! `dunce::canonicalize` calls used by fs-scope security gates. `time_to_idle
24//! = 60s` bounds staleness against external renames while hot paths stay
25//! cached indefinitely.
26//!
27//! Both caches are additive performance helpers; consumers continue to
28//! function with any one of them disabled.
29
30pub mod AssetMemoryMap;
31
32pub mod PathCanon;