4 ms·
Effortless API Request Caching with Python and Redis
- js2 6y ago404. Correct URL is https://rednafi.github.io/digressions/python/database/2020/05/25/python-redis-cache.html https://rednafi.github.io/digressions/python/database/2020/0... When using a cache like this, it’s usually better to serve stale data from the cache while kicking off a single background worker to refresh the stale data. Otherwise with significant traffic when the cached item expires you end up with many concurrent requests to the upstream resource, sometimes termed the thundering herd problem. https://en.wikipedia.org/wiki/Cache_stampede https://en.wikipedia.org/wiki/Cache_stampede