-
Notifications
You must be signed in to change notification settings - Fork 10
potential conflicts with cachebusted filenames? #15
Comments
I'll reach out to the Gatsby community to see if we can find a way for a better cache bust. As far as I understand Gatsby v2, it cleans the |
I can confirm that I am experiencing the same problem. |
I just released Please check it out via |
Thanks @axe312ger! I think that this will solve my issues. |
Would be sweet if a solution can be made to caching the |
@kentcdodds this should be possible with the new beta.
|
Will that not suffer from the original issue? |
It might till Gatsby cleans the public directory from old files on its own. I unfortunately found no option to detect obsolete files with Gatsby to avoid caching no more used files :( |
Any chance this plugin could detect files that are over a week or two old and delete those? |
Hmm yeah, since the timestamps are preserved I could add a feature to delete old files. Good idea! |
Any suggestion how the config could look like? |
I could envision a very low-level API like this: plugins: [
{
resolve: "gatsby-plugin-netlify-cache",
options: {
shouldDelete: file => {/* return true if it should be deleted? */},
extraDirsToCache: [
"public/static"
]
}
}
] And then a higher-level API/config like this: plugins: [
{
resolve: "gatsby-plugin-netlify-cache",
options: {
expirationTime: '2 weeks', // you could feed this into npm.im/ms
extraDirsToCache: [
"public/static"
]
}
}
] Thoughts? |
Hi folks,
I work on the Netlify tech support team. We recently had a customer whose ~2000 page build had reached ~140,000 pages due to your plugin. This site had grown so large that it was causing deploys to fail due to size. While I didn't do any further debugging, below I list the observed symptoms. His normally-~400MB site was swollen in size to 6GB. Removing your plugin caused things to return to normal.
Anyway, it'd be great if you didn't try to cache changing filenames. Here's an example subset. Format is
name - size
while there is only one copy of the file "34-HASH.js".
I don't have good repro steps, but hopefully that gives you enough insight and maybe that customer will speak up here with more details about their setup.
The text was updated successfully, but these errors were encountered: