Skip to main content

Module read_cache

Module read_cache 

Source
Expand description

Valence-wide read-through LRU for Model::get-shaped point reads.

Enable: default on; set VALENCE_READ_CACHE=0 to disable. Capacity: VALENCE_READ_CACHE_MAX (default 10_000).

Stores raw rows pre-privacy; callers still run check_read_privacy per request actor. When ownership_unified_fetch_enabled is on, cache entries bundle the main row and ownership gate status so warm reads avoid a second ownership trip. Write paths invalidate via generated Model ops and OwnershipService.

Functions§

get_record_via_cache
Point-get with optional read-through cache (raw row, pre-privacy).
get_record_with_ownership_bundle_via_cache
Unified Model::get fetch: one backend round trip for row + ownership gate status (when cache cold).
invalidate
Drop a cached row after a write or ownership status change.
read_cache_enabled
Whether the read-through record cache is active (default on; VALENCE_READ_CACHE=0 disables).