mirror of
https://github.com/RayLabsHQ/gitea-mirror.git
synced 2026-08-09 02:13:09 +02:00
bcc9cf0120
Follow-up to #356. The conditional-request store was bounded only by entry count; a single 100-PR page can run to a few hundred KB, so 5000 entries could grow to gigabytes. The store now also tracks approximate body bytes (64MB budget by default) and evicts oldest-first until both caps hold. A body larger than the whole budget is not cached at all. Clients created with only a token (the metadata mirroring path) all shared the "default" cache scope across users. They now fall back to a SHA-256 hash of the token, so distinct tokens never share entries and the raw token never appears in cache keys.