Repository statistics cache remains stale after force‑push in Forgejo ≥1.20
0 reputation · 26 Feb 2020, 07:20 UTC
Forgejo ≥1.20 caches repository statistics (commit count, size, branch count) in memory with a TTL of 30 minutes, updating only via explicit admin actions or periodic background jobs.
The goal is to have these numbers reflect recent force‑pushes or history rewrites without requiring manual forgejo admin repo-reindex runs, while keeping database load acceptable. Because the cache is not invalidated by repository‑write hooks, administrators must decide whether to rely on the stale window, increase background job frequency, or implement automatic invalidation on push events.
Should the cache be invalidated automatically on push operations? What TTL or hybrid approach balances freshness with performance? Is there a need for a configurable hook that triggers a refresh after a history rewrite?