Trophies.gg employs caching to reduce the number of API requests made to RAWG for video game metadata (background images, metacritic scores, etc.)
Currently, go-cache is used as a simple in-memory storage solution, but this isn't persistent. While go-cache does offer a workaround solution for persistence, I think we should look to optionally support Redis (in place of go-cache) if a REDIS_URI environment variable is detected.
go-redis is the official and de facto Go client for interacting with a Redis server.
This feature should involve creating an interface for the cache (currently, the specific implementation of go-cache is used in env.Env). Then, we can swap out the underlying implementation of the cache interface depending on what environment variables are set.
Trophies.gg employs caching to reduce the number of API requests made to RAWG for video game metadata (background images, metacritic scores, etc.)
Currently, go-cache is used as a simple in-memory storage solution, but this isn't persistent. While go-cache does offer a workaround solution for persistence, I think we should look to optionally support Redis (in place of go-cache) if a
REDIS_URI
environment variable is detected.go-redis is the official and de facto Go client for interacting with a Redis server.
This feature should involve creating an interface for the cache (currently, the specific implementation of go-cache is used in
env.Env
). Then, we can swap out the underlying implementation of the cache interface depending on what environment variables are set.