Netlify builds earlier version

I have a Gatsby-site working with Builder and Netlify.
Netlify builds the site with no problem using webhooks inside of Builder.

The problem is that when I hit publish inside of Builder it triggers a new build on Netlify but it’s not the recent changes I’ve made, it’s the changes I published before the recent ones.
What might cause this? Caching?

When building my site I clean the cache everytime with gatsby clean.

Example of what I mean

INSIDE BUILDER

  1. [Earlier edits made to a content]
  2. Opening upp content and changing for example the font-color of the header to red.
  3. Hit publish.
  4. Netlify builds with no problem.
  5. Visiting the live-site showing only the earlier edits made to the page. Not the font-color set to red.
  6. Going back into builder and switching the font-color to green this time.
  7. Hit publish.
  8. Once again, netlify builds with no problem and when I visit my site, the font-color of the header are now showing red and not green as it’s supposed to. Meaning it took a previous version and uploaded.

Why is it that I can’t see the recent changes?

If i hit Trigger Deploy inside of netlify, the recent changes are now showing.

Should I set up Gatsby differently so It always gets the latest json from Builder?

Hope you understand my problem.
Thank you!

Hi @iohan , welcome to the forum! Are you busting the Builder cache when you query content? You can take a look at this starter to see how to pass cachebust to options. If you are using the latest version of the @builder.io/gatsby plugin then there is also a useCache option you can read about here that should be false by default so make sure that it is not set to true.

Thank you for fast reply.
The cachebust fixed my issue.

1 Like