pyboxbuilder.packing.cache

Two-level layout cache — in-memory LRU + user cache JSON with SHA-256 hash keys.

Functions

cache_key

Generate a SHA-256 hash cache key from serialized input.

get_cached

Get a cached value by key (checks memory first, then disk).

get_memory_cached

Fast process-local lookup without disk I/O.

layout_cache_clear

Clear all caches (memory and disk).

load_cache

Load the disk cache into memory.

save_cache

Save the cache dictionary to disk (best-effort on read-only environments).

set_cached

Store a value in both memory and disk cache.

set_memory_cached

Fast process-local store without disk I/O.