0
votes

I made a simple application using Gatsby.js and Contentful CMS. I am hosting app on Netlify.

I am using Contentful webhooks to triger automaticly site builds and the problem for me is that each time I add / edit some content in CMS it triggers another webhook and build. For example - during 10 minutes I had making some changes on Contentful and result of that was 6 page rebuilds.

Maybe it is not problem for smaller pages but I wonder how things will go when site will enlarge and build will take not few seconds but 5-10min for example.

My question - is any option to 'delay' trigerring webhook or something? Probably it can be done programatticaly, I am begginner developer so I am not sure ;)

And another thing - do you know how Gatsby handles application rebuild when only one item in CMS changed? Does it always need to rebuild all static pages or there is an option to rebuild only those parts of site where content changed (like in React for example)?

1

1 Answers

1
votes

I am using Contentful webhooks to triger automaticly site builds and the problem for me is that each time I add / edit some content in CMS it triggers another webhook and build.

Did you check the options of the webhooks? I don't use Contentful but maybe you should only save / edit and not publish? Only when you publish the webhook gets triggered.

Maybe it is not problem for smaller pages but I wonder how things will go when site will enlarge and build will take not few seconds but 5-10min for example.

That's not a problem with Netlify. You don't have to wait for e.g. five builds if you just triggered the sixth. According to this blogpost it'll build the first and then skip to the sixth.

And another thing - do you know how Gatsby handles application rebuild when only one item in CMS changed? Does it always need to rebuild all static pages or there is an option to rebuild only those parts of site where content changed (like in React for example)?

No, Gatsby rebuilds the whole site. There's currently no support for incremental builds.