Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache always invalidated #51

Open
wfendler opened this issue Oct 7, 2021 · 6 comments
Open

Cache always invalidated #51

wfendler opened this issue Oct 7, 2021 · 6 comments
Labels
bug Something isn't working

Comments

@wfendler
Copy link

wfendler commented Oct 7, 2021

I'm working on upgrading from Gatsby 2 to 3 and decided to try this instead of the graphql source plugin. Every time i restart the develop script the cache is invalidated and I wait 10+ minutes to rebuild.

I've tried eliminating plugins and simplifying the project but have made no progress. I can try to create a minimal reproduction later but I wanted to report this in case there was something I'm missing that could solve this issue.

Here's what I'm seeing each time I start the project up:

info 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.
...
info Cached content is unavailable or outdated, sourcing _all_ nodes.
@wfendler wfendler added the bug Something isn't working label Oct 7, 2021
@andris-sevcenko
Copy link
Contributor

For some reason, Gatsby is invalidating your caches and then the gatsby source plugin can't find its caches. I'm not sure it's something this plugin does - can you determine whether it's something that only pops up once you add this plugin to the mix?

@andris-sevcenko
Copy link
Contributor

@wfendler for what it's worth, I've reached out to Gatsby to see if they can offer some help pinpointing the cause for the caches being cleared all the time.

@wfendler
Copy link
Author

wfendler commented Oct 7, 2021

@andris-sevcenko thanks for your help! I'll be trying to make a smaller reproduction of the issue. I did find some info related to these issues here: https://www.gatsbyjs.com/docs/reference/release-notes/v2.28/

I'll be testing those flags out today. It seems there's very little to make this initial build fast with a good amount of content in Craft. I'm okay with that, it's just the constant clearing and rebuilding that's getting to me.

@KyleAMathews
Copy link

The cache is invalidated when you either a) edit gatsby-node.js or gatsby-config.js or b) install/upgrade a package.

The check lives at https://github.com/gatsbyjs/gatsby/blob/751cc43193edec3e3320f399e0cc895318959fe4/packages/gatsby/src/services/initialize.ts#L301-L306 — you can try editing node_modules/gatsby/dist/services/initialize.js to see what values are being compared. Another potential cause is your site isn't storing or retrieving the cache successfully.

@andris-sevcenko
Copy link
Contributor

@wfendler any luck?

@wfendler
Copy link
Author

@andris-sevcenko - unfortunately not. I couldn't spend more time on the transition to Gatsby 3 so I wasn't able to resolve it or create a minimal reproduction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants