Gatsby Incremental Builds

Hello I am following along with this article on Incremental Builds for my site.

The deploy time is still approximately the same. Went from 4 minutes to 3 minutes and 20 seconds which makes me think I am missing something in my configuration

One thing I am confused about is the netlify.toml file in step 3 I have never heard of the file extension before. Do I need to use it and where should I add it?

I am using the netlify-cache plugin and followed the steps to add using the documentation on Gatsby with no options being passed.

Using this plugin do I still need the add the netlify.toml file and where do I do or add this?

I believe I have everything else set up including upgrading to the latest Gatsby and enabling the netlify beta plugin features in the UI

Thank you and have a wondeful day

Hey @aquasar,

The netlify.toml allows for file-based configuration and you will need to use this file for the build plugin. The netlify.toml file usually sits alongside your package.json :+1:

Happy to help further!

Thank you!
Works now

1 Like

Excellent news! :running_man:

Hey! Could you clarify what you´re supposed to do with the netlify.toml file? I can’t get it to work.

Hey @wahlforss,

So, you’ll need a netlify.toml file (which usually lives in the root of your site repo) with the following:

[[plugins]]
package = "netlify-plugin-gatsby-cache"

Hope this helps!

I have question about this, sorry if it’s the wrong post.
I am also in touch with the Gatsby support for the same issue.

Does the gatsby incremental build work even WITHOUT a gatsby cloud connected site (so with just normal Gatsby code deployed to a netlify site) ?

I am using Netlify creating many sites via CLI and APIs, but gatsby cloud does not seems to have a programmatic way to create sites. So I was wondering if I could still reach incremental builds for many sites without manual intervention

hi there @stilllife00 - I definitely think it should run on netlify - have you tried deploying with or without the incremental builds to see what it does?

I tried a normal build and a build after following this tutorial: https://www.netlify.com/blog/2020/04/23/enable-gatsby-incremental-builds-on-netlify/
and they both run the same speed (which btw seems quite high 1 min 50 seconds for a simple SPA)
As mentioned I do not have a Gatsby cloud site, is Netlify building from Gitlab and I connected a webhook to Sanity.io to trigger a build on content change.
It’s quite a pity to wait 2 minutes for just a tiny content change, it would be great if I can reduce this down to 10-20 seconds

ERRATA: with a clean site (i had some config issues on the other site) I managed indeed to see a benefit with incremental builds from 1min 30sec down to 30 sec of build time :+1:

I will now try to reduce it even further if possible

1 Like