0
0
Fork 0
mirror of https://github.com/matrix-org/dendrite synced 2024-12-17 20:13:42 +01:00
dendrite/common/caching/immutablecache.go
Neil Alexander f0e0a6668f
Prometheus metrics for LRU cache (#1039)
* Add prom metrics for the in-memory LRU cache

* Increase cache sizes
2020-05-15 11:27:10 +01:00

17 lines
560 B
Go

package caching
import (
"github.com/matrix-org/gomatrixserverlib"
)
const (
RoomVersionMaxCacheEntries = 1024
ServerKeysMaxCacheEntries = 1024
)
type ImmutableCache interface {
GetRoomVersion(roomId string) (gomatrixserverlib.RoomVersion, bool)
StoreRoomVersion(roomId string, roomVersion gomatrixserverlib.RoomVersion)
GetServerKey(request gomatrixserverlib.PublicKeyLookupRequest) (gomatrixserverlib.PublicKeyLookupResult, bool)
StoreServerKey(request gomatrixserverlib.PublicKeyLookupRequest, response gomatrixserverlib.PublicKeyLookupResult)
}