Expand description
LRU rotation / eviction policy for the asset cache.
The rotator is stateless: every call evaluates the index and deletes
whichever assets need to go based on the configured
EvictionPolicy and size / age limits.
Eviction priority for LRU:
- Assets older than
max_file_age(bylast_accessed) are removed unconditionally. This implements the TTL behaviour described in the ADR. - If the remaining cache is still over
max_cache_size, assets are removed in LRU order (oldestlast_accessedfirst) until the budget is met. Within the same timestamp bucket, larger files go first so one multi-GB video is preferred over many small logs.
Structs§
- Rotation
Stats - Stats produced by a rotation pass — exposed so callers can log what happened and tests can assert on side-effects.
- Rotator
- Applies an
EvictionPolicyto anAssetIndex+ cache root.