When using ImageCache with private files, _imagecache_cache() is invoked for all generated images, even though the generated file already exists.

_imagecache_cache() generates a lock file. This is a somewhat expensive an unnecessary operation.

I suggest checking for the presence of $dst as early as possible, possible even before the is_file($src) check (unless you want to prevent access to generated files after the source image has been deleted), and only use a lock file when generating images.

Comments

dopry’s picture

the lock file should only be used when generating images... looking at _imagecache_cache and imagecache_cache_private... It seems like imagecache_cache_private should be checking for dst before calling _imagecache_cache.... before private files I was depending on apache to do this... Do you have time to roll a patch?

dopry’s picture

nm this should be fixed in head...

dopry’s picture

Status: Active » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.