Hwaro::Core::Build::CacheManager
Inherits Reference / Object
Constructors
Instance methods
Clear specific named caches.
Pass reset_stats: false to preserve hit/miss counters across clears
(useful for streaming batch clears where stats should span the whole build).
Clear all registered caches (both runtime and persistent).
Pass reset_stats: false to preserve hit/miss counters (e.g. for
memory-management clears where you still want end-of-build reporting).
Clear only runtime (in-memory) caches, preserving persistent caches.
Pass reset_stats: false to preserve hit/miss counters.
Record a cache hit for the named layer.
Deliberately lock-free: the counters are Atomics precisely so hot render paths don't serialize on @mutex (record_hit/record_miss run several times per page from parallel fibers). The bare @layers read is safe because layers are registered once during Builder construction, before any parallel phase mutates or reads stats.
Record a cache miss for the named layer. Lock-free — see record_hit.
Register a cache layer with the manager.
runtime: true for per-build in-memory caches, false for persistent (file-based) caches.
Get an immutable stats snapshot for a specific cache layer.