Update
DevPlace CI / test (push) Has been cancelled

This commit is contained in:
2026-06-19 10:06:09 +02:00
parent 823fff0e6a
commit 016d2d1c76
136 changed files with 3025 additions and 564 deletions
@@ -21,7 +21,7 @@ The in-process caches (`_user_cache` in `utils.py`, `_settings_cache` in `databa
- A mutation that must invalidate a cache calls `bump_cache_version(name)` - an atomic `UPDATE ... version + 1` in the shared table.
- Before serving from a cache, the worker calls `sync_local_cache(name, cache)`, which reads the table's version and compares it to the version its local cache was built against; if they differ, it clears and rebuilds the local cache from the database. The version read is an uncached indexed primary-key lookup on the tiny `cache_state` table, so invalidation is immediate across workers.
A logout, ban, role change, or settings save in one worker is therefore honored by every other worker on its next request, while the common path stays a cheap in-memory hit. `auth` covers `_user_cache` (logout, deactivation, role and password changes); `settings` covers `_settings_cache` (every `set_setting` and the admin settings save).
A logout, ban, role change, or settings save in one worker is therefore honored by every other worker on its next request, while the common path stays a cheap in-memory hit. The named versions in use are `auth` (covers `_user_cache`: logout, deactivation, role and password changes), `settings` (`_settings_cache`: every `set_setting` and the admin settings save), `relations` (block/mute lists), `customizations` (per-user CSS/JS), `notif_prefs` (notification preferences), `gateway_routing` (AI provider/model routes), and `admins` (the cached admin-user set behind `get_admin_uids`/`get_primary_admin_uid`, invalidated by `invalidate_admins_cache()` on every role change). Caches whose value is deterministic or only cosmetically stale do not use a version: the docs prose markdown is memoized on its static source, and the guest home page blocks use a short 60-second time-to-live.
## Rate limiting