System settings cache lifecycle
Role
System-wide settings (feature flags, maintenance categories/priorities, email templates metadata, etc.) are read frequently and cached via the system settings path (SystemSettingsService / related cache namespaces in apps/worker).
Read path
- Prefer cached settings when available.
- On miss, load from DB (or authoritative store), then populate cache.
Write path
When an administrator (or authorized role) updates a setting:
- Persist to DB.
- Invalidate or update the relevant cache key(s).
- Dependent features (e.g. maintenance create validation against allowed categories) must see consistent values on the next read — avoid long stale windows for validation-critical keys.
Relationship to maintenance
Maintenance create/update validation that consults system settings (categories, priorities, feature flags) must use the same cached settings source as the rest of the app so validation matches UI options.
Related documentation
- ../maintenance/README.md
../../guides/configuration/README.md(if present for env vs system settings)