Incremental builds seem to be using two competing caches

Our Gatsby site pulls content from WordPress. We have a new page that is leveraging WordPress comments - each time a new comment is approved a build is generated and a new block (with the new comment) is added to the page.

The problem is that other incremental builds not triggered by this page or new comments are constantly changing this page. The page is supposed to have 9 comments on it like this Wisconsin Wall of Wisdom | Wisconsin Alumni Association
But every other incremental build reverts to a version with only 4 comments on it like this
Wisconsin Wall of Wisdom | Wisconsin Alumni Association

Both the “4 comment” and the “9 comment” incremental build logs show the line

Found a Gatsby cache. We’re about to go FAST. :zap:

It’s like there are two different competing versions of the cache that the site keeps ping-ponging between.
None of these builds show any information acknowledging that the page in question was changed.

Any ideas on how I can troubleshoot this further? This is a high profile page for the next few days, and we are starting to get a lot of flak for this problem.

Additional info: we did a full cache-clear rebuild at 12:06 today which fetched 4 Comments, and then another at 1:58 which fetched 9 comments. I would think the most recent one would take precedent, but again, it seems like perhaps there are two different caches being referenced(?)

hey James,

Thanks for reaching out, and I’m so sorry for the delay here! The fact that this behavior was also replicable when you cleared the cache suggests that the root cause may not be related to competing caches, although I’d also be curious as to which method you used (clearing the cache via the Netlify UI or gatsby clean).

If this is still occurring, do you see the same behavior locally? That will help us narrow down where the potential issue might be. Thanks again!

Marcus! Nice to see you here.

I was clearing cache via the Netlify UI - I’m not sure I’d know how to clear it via gatsby clean in the Netlify environment. I’d be curious to know any tricks along those lines, or what the difference is. (I guess I assumed that “Clear cache and retry latest branch commit” inside of Netlify would include a “gatsby clean” directive.

The reason I suspected two competing caches is because incremental builds would bounce between two different numbers of comment nodes. If I recall, these corresponded to the last two full builds (since incremental builds never seemed to successfully ADD a new comment, even though adding a comment in WordPress did trigger an incremental build.

The urgency of this particular situation is over now, but we definitely are having various issues with some of our Netlify incremental builds, seemingly related to Gatsby and gatsby-source-wordpress. I’ve been struggling to figure out how to get help on those, and I have not posted on here much, figuring there was not much if any Gatsby-specific help available.

Likewise!

Clearing it via gatsby clean in Netlify would just entail something like adding gatsby clean as part of your build command - which isn’t altogether recommended due to the performance implications of clearing the cache on every build.

For any lingering issues with your Gatsby WordPress site, you can definitely continue posting here or reach out to our Support team internally if you need a faster reply.