This issue has already been brought up and in most cases seems to involve gatsby-plugin-offline.
I am NOT using gatsby-plugin-offline and I still have this problem. Whenever I push to the remote, my live site will update all changes I make except new blog posts, supposedly due to graphql not querying another time after the site has been cached. But during production on my localhost it updates instantly.
I find it confusing to read all the different cases of this error, for instance in this thread it says that you SHOULD use gatsby-plugin-offline to solve the issue. Gatsby Site Requires Refresh to View New Data
It shows how to create a popup whenever the site needs to refresh. Is there really no other way? Is it not possible to simply have a Gatsby site work like a normal website, automatically showing the latest blog posts?
The issue has been solved but I forgot to update it. My caching was not set up correctly. I use Firebase for hosting, and following these instructions I updated my firebase.json file and everything now updates as it should.
https://www.gatsbyjs.com/docs/how-to/previews-deploys-hosting/deploying-to-firebase/
My path to the solution: https://github.com/gatsbyjs/gatsby/discussions/35262