How it works
Runtime code reads values only through get_value(). ORM reads of a single key, custom cache-aside keys, and domain fallbacks are out of scope for this package.
Read contract
- Read
global-config:{key}from Django cache. - Accept only a
GlobalConfigCacheValueDTO. Legacy untyped entries are a miss. - On miss, wait for
global-config:refresh-lock. - After acquiring the lock, re-check the requested key.
- If another process has not published, read every
GlobalConfigrow. - Fail if any declared definition key is missing.
- Parse the full snapshot. One parse failure aborts publish.
- Publish values and the readiness marker with
set_manywhile the lock is still owned. - Resolve the requested key.
SECUREis decrypted only in memory.
There is no single-row database fallback in get_value(). Keys have no TTL. A committed save refreshes that key directly; full refresh handles cache-miss recovery and reconciliation.
Refresh triggers
- synchronous cache miss
- targeted refresh of the saved key after
post_saveviatransaction.on_commit() post_migrateafter initialization- optional Celery task
django_gc.refresh_global_configs_cache
Initialization suppresses per-row refresh and schedules one full commit-time refresh.
Rows live in the explicit global_configs and global_config_categories
tables. The category table stores only numeric identifiers, while its Admin
labels come from project definitions.