You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(cache): drop L2 (shared) tier for singleton settings cache; L1-only
The singleton settings cache (dojo/caching.py) becomes a single in-process L1
tier; the shared django.core.cache (L2) tier is removed. Cross-process/worker
freshness is provided entirely by resetting L1 at each request and task boundary
(middleware + DojoAsyncTask), so each request/task reads a singleton from the DB
at most once and never serves a value cached during a prior request/task.
Why no L2 for settings singletons:
- The dedupe correctness fix only needs each task to see current config, which
the per-task L1 reset already guarantees by re-reading the DB -- a shared L2 +
cross-process invalidation is not required for correctness.
- L2 added real cost and complexity for little gain on these tiny, hot
singletons: a Redis dependency, pickled-vs-dict storage and version-keying,
cross-process invalidation, and Redis-down fragility -- while the headline win
(avoiding repeated reads within a bulk loop) comes from L1, not L2.
- Trade-off: one small indexed DB read per singleton per request/task instead of
amortising across processes via Redis. Acceptable for low-cardinality config.
Removes SETTINGS_CACHE_L2_TTL and the L2 read/set/delete paths. DD_CACHE_URL and
the Redis default django cache backend stay (used by other framework caching).
Unit-test overrides drop the now-defunct L2 TTL var. test_caching rewritten to
the L1-only contract.
Copy file name to clipboardExpand all lines: dojo/settings/settings.dist.py
+11-13Lines changed: 11 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -280,16 +280,15 @@
280
280
DD_V3_FEATURE_LOCATIONS=(bool, True),
281
281
# Dictates if v3 org/asset relabeling (+url routing) will be enabled (on by default as of 3.0.0; set to False to restore Product/Product Type labels and URLs)
0 commit comments