gatsby-plugin-netlify-cache
gatsby-plugin-netlify-cache copied to clipboard
Missing significant number of files in cache
On a website with 2938 pages I'm seeing just a tiny fraction being restored from the Netlify cache during a build.
From a successful, primary branch build:
2:28:56 PM: plugin-netlify-cache: Caching public...
2:29:05 PM: plugin-netlify-cache: Caching .cache...
2:29:05 PM: plugin-netlify-cache: Netlify cache refilled
[…]
2:29:54 PM: 5887 new files to upload
From a subsequent primary branch build:
5:39:35 PM: Starting to download cache of 390.9MB
5:39:37 PM: Finished downloading cache in 2.722422294s
5:39:37 PM: Starting to extract cache
5:39:53 PM: Finished extracting cache in 15.858184728s
5:39:53 PM: Finished fetching cache in 18.765777615s
[…]
5:40:14 PM: plugin-netlify-cache: Restoring 196 cached files for public directory with 0 already existing files.
5:40:20 PM: plugin-netlify-cache: Restoring 45 cached files for .cache directory with 1 already existing files.
5:40:20 PM: plugin-netlify-cache: Netlify cache restored
My Gatsby config has been set to cache public. This seems obvious given the logs, but just to cover all of the bases…
{
resolve: "gatsby-plugin-netlify-cache",
options: {
cachePublic: true,
},
}
gatsby-plugin-netlify-cache doesn't count the amount of file recursively src, so those are both directories and files.
Ah, okay. Might be useful to update the log output for clarity. Is there any other way to inspect or review the cache or stats about it? Would love to be able to opt into a full recursive count of files, even if it adds a few seconds to a build.
I agree, would be neat to be able to see new files count in cache after each build as well!