0
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-12-17 06:53:31 +01:00
gitea/modules/setting
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
..
attachment.go
cache.go Add LRU mem cache implementation (#16226) 2021-07-10 23:54:15 +02:00
cors.go
cron_test.go
cron.go
database_sqlite.go
database_test.go
database.go
git.go
indexer_test.go
indexer.go
lfs.go
log.go
mailer.go
markup.go
migrations.go
mime_type_map.go
oauth2_client.go
picture.go
project.go
queue.go
repository.go
service.go
session.go
setting_test.go
setting.go
storage_test.go
storage.go
task.go Avoid setitng the CONN_STR in queues unless it is meant to be set (#13025) 2020-10-04 18:12:26 +01:00
webhook.go