Content Delivery API
CDA jitters retries to prevent hitting rate limits
If you've ever triggered a big static build and watched it fall flat because of rate limits, this one's for you 🫶🏽
Earlier, with big builds, all those requests for pages/posts/etc., hit us at the same time, and some get rate-limited, so the client retried them. Plot twist, every retry also fired at the same instant. So we were constantly retrying in perfect lockstep.
To fix this, we've added jittering into the retries on the CDA client. Instead of all retries going out at once, we spread them across a small randomized window to stagger the requests.
If you run large static builds, this should slowly cut down your rate-limit errors.
You will need to npm update @datocms/cda-client for this to work on your project.