Nginx: Protecting upstream from overload on cache miss
These 2 magical lines will protect your upstream server from possible overload of many users try to access the same in cached or expired content:
You can verify this using Shopify's Toxiproxy.
<3 Nginx
proxy_cache_use_stale updating timeout; # Serve the cached version even when outdated while refreshing it proxy_cache_lock on; # Only one req is allowed to load/refresh the item, others wait / get the stale one
You can verify this using Shopify's Toxiproxy.
<3 Nginx