Add in-memory result cache with 1-hour TTL
DB is now queried at most once per hour per user; subsequent requests within the window are served from memory. TTL matches the existing Cache-Control header. Restart clears the cache immediately. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -64,10 +64,10 @@ Set `OP_TYPES=5,6,7,9,11,18,24` for a more inclusive count.
|
||||
- **Template drift.** The harder part. Gitea's `profile.tmpl` does change
|
||||
between versions — diff the new upstream against your override on each
|
||||
upgrade and re-merge the snippet.
|
||||
- **Cache.** 1-hour `Cache-Control` header keeps load trivial. Drop to 5
|
||||
minutes for snappier updates if needed; the underlying query is cheap
|
||||
thanks to the existing index on `(user_id, act_user_id, created_unix)`
|
||||
added in Gitea 1.24.
|
||||
- **Cache.** Results are cached in memory for 1 hour (matching the
|
||||
`Cache-Control: max-age=3600` response header), so the DB is only hit
|
||||
once per hour per user regardless of traffic. Restart the service to
|
||||
clear the cache immediately.
|
||||
|
||||
## Local dev
|
||||
|
||||
|
||||
Reference in New Issue
Block a user