Framework or Component Caching #31734
Unanswered
shawngrona
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello - I have noticed some fatal errors on my Gatsby site after changes to graphql in a component. It looks like a caching issue somewhere - on my site I've followed and validated all of the recommended caching is set correctly per https://www.gatsbyjs.com/docs/caching/
I've got a React error boundary set up that allows the user to refresh the page when this occurs and it appears that after refresh the error disappears, again pointing to caching.
I've seen this kind of thing before and after a few days, the errors stop - again pointing to caching. Its as if some part of the Gatsby app is being cached in the browser and is causing issue.
I realize this is a pretty open ended question, but does anyone have any recommended approach to track this down?
[edit]
In observing my stack trace coming from the client, it really seems like page-data.json is being cached, which has changed since the graphql refactor I mentioned above.
So it looks like the browser client has downloaded a bunch of page-data.json and maybe not called for it again on navigation despite grabbing a new *.js file (ie changes to react component). maybe? I show my page-data.json files to all be
cache-control: public, max-age=0, must-revalidate
In clicking around my site, I find that page-data is eagerly loaded for pages in view... if you click on one of the pages where page-data is already load, it doesn't reload that page-data.json file. So if the errors I'm seeing seem to indicate the user has an updated component.js (ie React component update) but stale page-data (despite cache control set as mentioned above), what does this mean/how to troubleshoot?
Another thought - could be a crawler on my site triggering these issues.
@KyleAMathews I'm in deep here and have seen you communicate in dicussions, is there any way you can point me to someone who can help me work this through?
Beta Was this translation helpful? Give feedback.
All reactions