11ty / eleventy-img

Utility to perform build-time image transformations.

Home Page:https://www.11ty.dev/docs/plugins/image/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

having trouble getting disk cache to work

btrem opened this issue · comments

Note: copied from 11ty/eleventy#2619 on the advice of 11ty/eleventy#2619 (comment).

I'm using 11ty/image. Each time I run 11ty --serve, all of my images are reprocessed, making the initial build time very slow. According to https://www.11ty.dev/docs/plugins/image/#disk-cache, this shouldn't happen.

Eleventy will skip processing files that are unchanged and already exist in the output directory.

Issue #51 seems to indicate that persisting the cache to disk has been added to image as of 1.0.0. Is there something I need to do to my async image function to enable the disk cache feature?

Are you deleting the output folder by any chance? Usually it happens by rm -rf or rimraf ing the 11ty output directory in package.json, which also contains the cached eleventy_img images.

No. I never run the clean or production script (so never rm -rf).

Ouf. Just checked image file dates, and it turns out it is not regenerating images every time. There is apparently something else which is slowing down my initial run.

Apologies to all.

Happens, don't worry about it :)