Skip to content

How to Reduce Gatsby Build Time on Netlify


You can greatly reduce Gatsby build time on Netlify by enabling Gatsby cache plugin. You should also update to Gatsby v3 because it introduces performance upgrades.

Before you set up Gatsby cache on Netlify, I recommend updating your build command to include --log-pages. This will allow you to see if only the changed pages get built while deploying a new version of your site.

"build": "gatsby build --log-pages"

Visit this link to install Gatsby cache plugin.

Now make a change to your site and deploy it. On your first deploy, you should see no improvements. Since you introduced a new plugin, Netlify will empty the cache.

Check the deployment logs and you will find the following text.

One or more of your plugins have changed since the last time you ran Gatsby. As
a precaution, we're deleting your site's cache to ensure there's no stale data.

You will also see that all your pages are being updated thanks to the --log-pages parameter you specified.

Go ahead and make some changes and deploy them. This time, you should see a message that a cache has been created.

Stored the Gatsby cache to speed up future builds.

Now when you update your site and deploy it, only the updated pages should be appear in the deployment logs.