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

A cache of '_site/images, .cache' doesn't exist (yet) #1

Open
mirisuzanne opened this issue Jun 10, 2022 · 6 comments
Open

A cache of '_site/images, .cache' doesn't exist (yet) #1

mirisuzanne opened this issue Jun 10, 2022 · 6 comments

Comments

@mirisuzanne
Copy link

I must be doing something wrong. I followed all the setup instructions here, but I still have builds timing out at 26+ minutes, with this in the deploy log:

7:53:22 PM: A cache of '_site/images, .cache' doesn't exist (yet).
7:53:22 PM: (netlify-plugin-cache onPreBuild completed in 14ms)

I also set up netlify-plugin-debug-cache which documents the cached files in a json file… that is consistently empty.

I'm not sure how to debug this… Any help would be welcome! Thanks!

@jacob-rh
Copy link

jacob-rh commented Oct 6, 2022

Hey @mirisuzanne @zachleat I wonder if a solution for this was ever nailed down?

I have an 11ty site that builds 300+ files in 3.5 seconds locally (using the remote image cache) but on netlify, the build can take anywhere between 15-20 minutes.

I've followed this link as a guide for my netlify toml config: https://github.com/11ty/demo-eleventy-img-netlify-cache

And when the build happens, it seems to be using the cache: Successfully restored: frontend/dist/images, frontend/.cache, .cache ... 1881 files in total

Just confusing me as to why the build should take so long, if it's not needing to fetch many new images.

@mirisuzanne
Copy link
Author

Hi @jacob-rh - what I discovered (thanks to Phil Hawksworth tracking it down) was that the eleventy build was working fine, but Netlify was failing to upload all the resulting images in their defined time limit. And Netlify only creates the cache once the upload is complete - so the cache never got built. We fixed it by limiting the number of images to upload in a series of preview builds, so that each build could completely upload and cache another subset of images. After 3 or 4 restricted builds to get all the images uploaded, everything is back in place, and deploys are working smoothly again.

The first build only had eleventy-img generate small images in one format, then the other builds slowly increased image sizes and formats until I had the full set that I wanted.

@jacob-rh
Copy link

Thanks @mirisuzanne sorry to bother you again, but I wonder if you have any direct reference or an example of how you went about this?

I'm struggling with an image-heavy site at the moment and the build time seems to be swinging from anywhere between 5 minutes and 20+ so something is still not quite right.

@mirisuzanne
Copy link
Author

@jacob-rh all I have is the commit log - it was around June, with Phil helping out - you can see several commits from him around this time: https://github.com/mirisuzanne/mia/commits/main?after=2500a606ef25e2485f90952a5fb5cd948057fce7+139&branch=main&qualified_name=refs%2Fheads%2Fmain

@jacob-rh
Copy link

Thanks so much for getting back to me again @mirisuzanne. Just wondering if you were using remote image sources for this approach? Or were all the images locally stored in the project?

I just noticed that Phil's approach was using statsSync to check if images already existed on the file system and skip if so, but you don't appear to be able to use statsSync for remote image sources 😢 .. I also tried using statsByDimensionsSync for remote images without any luck.

Feel like I'm at a dead end.

@mirisuzanne
Copy link
Author

Yeah, I'm not sure. I had some external images around then - for webmentions. But it was not the majority of my images. Hope you're able to find a solution, that's frustrating for sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants