perf: caching on statistics endpoint
I'll start by saying that the code here is probably not ideal, it is a lot of duplicate. I am unsure how to deduplicate it, as the SQL querries are different, and async. With that said, it appears to work well based on my testing. It caches the statistics for 30 minutes at a time, which heavily improves the response times of this endpoint.
Closes modrinth/code#2544
This would be great for #1301 on the monorepo.
This would be great for #1301 on the monorepo.
Correct me if I am wrong, but modrinth/code#1301 seems to be focusing on analytics, not the global statistics?
Are the statistics not used by analytics endpoints?
Oh I misunderstood, this is just the general labrinth instance statistics.