#cache failure when using content collection caching

24 messages · Page 1 of 1 (latest)

pastel thicket
#
  ▶ /_astro/radio-dish.c44aa7dc_2fiVAP.webp (reused cache entry) (+1ms) (54/450)
  ▶ /_astro/radio-dish.c44aa7dc_3EeVQ.jpg (reused cache entry) (+1ms) (55/450)
  ▶ /_astro/radio-dish.c44aa7dc_Z22kPDc.jpg (reused cache entry) (+1ms) (56/450)
 error   ENOENT: no such file or directory, open '/Users/calebjasik/Git/defined.net/www/dist/_astro/cells.e11787c1.jpg'
Error: ENOENT: no such file or directory, open '/Users/calebjasik/Git/defined.net/www/dist/_astro/cells.e11787c1.jpg'
 ELIFECYCLE  Command failed with exit code 1.

www on  astro-prefetch [$] via  v18.16.0 took 4s 

for some reason when I enable the experimental content collection caching in 3.5.0, I get this error. with it off the site builds fine, but with

 experimental: {
    contentCollectionCache: true,
  },

added, I get the above build error

#

cc @noble canopy

pulsar ether
#

Yep, Nate is aware

pastel thicket
#

my solution for the moment is just not to use the feature 🫡

#

ok

#

cool bean

#

(s)

pulsar ether
#

I found it instantly when I updated my own website to try it out, ha

pastel thicket
#

ha

#

ouch

#

at least it's consistent :p

noble canopy
#

Yeahhh this is something I’m tracking! Assets in content collections are particularly tricky with the caching method we’re using

viscid notch
#

Have to say initial results up to the fail on assets look extremely promising (461s -> ~30s) 💯

viscid notch
#

Interested by pointers or issue that tracks the progress of this, even though this is not trivial and experimental 🙏

noble canopy
#

I don't know if there's an issue but I'm currently working on it!

viscid notch
#

I was too excited by the release of the first version 😅 Should I expect an assets-enabled version of the cache for 4.0-ish or this is longer-term? Thanks again!

noble canopy
#

This flag will still be experimental for 4.0! Definitely a longer-term project to make this all as efficient as possible. I might be able to fix this particular issue prior to the 4.0 release, but I’ve had to prioritize some other stuff for the release and haven’t had a chance to wrap this fix up yet.

mental trellis
#

Got the same issue as OP but I just want to ask something: as the error points out of image file missing, is dist being cleaned before building the site with the experimental flag on by design? Because digging into dist\_astro I don't find any optimized images I've just built before

noble canopy
#

The dist directory is always cleaned out. Cached images live in the node_modules/.astro directory. The actual bug is that there was a new feature that tracks whether the original image is refereneced or not, but that breaks when the experimental flag is enabled

#

Again, I think I know a fix, just haven't had time yet! Since the feature is still experimental it's unfortunately a lower priority than some other 4.0 features going out

mental trellis
#

If adding some context might help you fixing the bug, I use custom img components that are rendered using astro content collection API and [..slug].astro

viscid notch
#

Quick question unrelated to the current limitation itself (feel free to redirect me to #general or else and I'll remove this message): is the contentCollectionCache expected to speed up subsequent builds on PRs as is, or do we need to track/allowlist the cache dir somehow? I'm using GitHub Actions just for information.

noble canopy
viscid notch
#

Going to test this immediately, thanks!