Cache
provide.foundation.serialization.cache
¶
TODO: Add module docstring.
Functions¶
get_cache_enabled
¶
get_cache_key
¶
Generate cache key from content and format.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
content
|
str
|
String content to hash |
required |
format
|
str
|
Format identifier (json, yaml, toml, etc.) |
required |
Returns:
| Type | Description |
|---|---|
str
|
Cache key string |
Source code in provide/foundation/serialization/cache.py
get_cache_size
¶
get_serialization_cache
¶
Get or create serialization cache with thread-safe lazy initialization.
Lock overhead (~20-50ns) is negligible compared to actual cache operations (~100-1000ns lookup, ~1-100μs for serialization).
Source code in provide/foundation/serialization/cache.py
reset_serialization_cache_config
¶
Reset cached config for testing purposes.
Thread-safe reset that acquires the lock.