robintrack
robintrack copied to clipboard
Incrementally clear cache after update rather than all at once
Currently, we drop the entire cache all at once as soon as each hourly scrape finishes. This has the effect of flooding the database with queries all at once and making the website very slow and in some cases even unresponsive while the cache re-populates.
The clearing of the cache can be mitigated by clearing it one piece at a time. Maybe clear the popularity history, wait 30 seconds, clear the quote history, wait 30 seconds, clear all or a part of the popularity changes cache, etc.