jlengstorf / netlify-plugin-gatsby-cache

185 stars 21 forks source link

Pages generated with gatsby-node.js stick around after deletion #46

Open EliotSlevin opened 3 years ago

EliotSlevin commented 3 years ago

Just wanted to report this issue to see if anybody else has had something similar. Haven't yet nailed down exactly why it's happening, but I suspect this plugin may be involved.

I've got a contentful datasource, which generates pages per object, deployed to netlify. I've noticed if I change the name or delete an object - the route is published with the new name, but the old built page sticks around? Looks super garbled as well too haha, like it's just the html that's left - the stylesheets it references have changed, etc.

I've verified by downloading the builds that the old pages are indeed being generated. My presumption is that they're being pulled from the cache, not recognising that the contentful source has changed.

Cleaning cache fixes everytime - and I do a fresh build always for prod so not a big issue.

But curious if anybody else has found this.

jlengstorf commented 3 years ago

@EliotSlevin have you checked local builds to see if these pages are still present between builds? my suspicion is that Gatsby isn't cleaning deleted pages, so they stick around until you delete them yourself

my reasoning for that assumption is that this page only copies a folder back and forth, so it couldn't affect your actual Gatsby config, but it'll definitely keep anything that Gatsby doesn't delete in its build artifacts

EliotSlevin commented 3 years ago

Hmm. In the local builds I can still see the folders? But they're empty, with no index.html inside them. I'll try do a more in-depth test.