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. Keys have no TTL. Freshness comes from a full refresh, not expiry.
Refresh triggers
- synchronous cache miss
post_saveonGlobalConfigviatransaction.on_commit()post_migrateafter initialization- optional Celery task
django_gc.refresh_global_configs_cache
Initialization suppresses per-row refresh and schedules one commit-time refresh.
Rows live in explicit tables global_configs and global_config_categories.