I’m using Netlify in conjunction with Contentful and have configured a Contentful Outgoing Webhook to trigger a Netlify Build Hook when content is updated. This got me wondering whether or not Netlify operates a build queue and, if so, how it works.
There is (at the time of writing) no formal documentation on this topic, so I hopped onto the Netlify Gitter conversation to see what I could find out. Thankfully Mathias Biilmann (the founder of Netlify, no less) was on hand to enlighten me.
It turns out they does use a build queue and this is how it operates:
We’ll start the first one, and then once that’s done, our system will mark all the intermediary builds as “Skipped” and then run the last one
Thankfully this is the logic that I was hoping for 🎉
In the case of the Contentful Content Preview API, the webhooks can be triggered fairly frequently (up to 3 times a minute) whilst content is being edited. My worry was that this was creating a race condition that could result in stale content winning out over fresh content. Thankfully these worries were unfounded.