forgejo-federation/routers
zeripath 2f725cbc9e
Add LRU mem cache implementation (#16226)
The current default memory cache implementation is unbounded in size and number of
objects cached. This is hardly ideal.

This PR proposes creating a TwoQueue LRU cache as the underlying cache for Gitea.
The cache is limited by the number of objects stored in the cache (rather than size)
for simplicity. The default number of objects is 50000 - which is perhaps too small
as most of our objects cached are going to be much less than 1kB.

It may be worth considering using a different LRU implementation that actively limits
sizes or avoids GC - however, this is just a beginning implementation.

Signed-off-by: Andrew Thornton <art27@cantab.net>
2021-07-10 23:54:15 +02:00
..
api/v1 Fix various documentation, user-facing, and source comment typos (#16367) 2021-07-08 13:38:13 +02:00
common Support custom mime type mapping for text files (#16304) 2021-06-30 17:31:54 -04:00
install just add some unit tests (#16291) 2021-06-29 22:00:02 +01:00
private Add tag protection (#15629) 2021-06-25 16:28:55 +02:00
utils just add some unit tests (#16291) 2021-06-29 22:00:02 +01:00
web Fix source typos (#16374) 2021-07-08 14:55:09 +02:00
init.go Add LRU mem cache implementation (#16226) 2021-07-10 23:54:15 +02:00