grav icon indicating copy to clipboard operation
grav copied to clipboard

Request: Stop Grav updates from wiping out 'images' folder

Open nicede opened this issue 3 years ago • 9 comments

I have multiple image gallery pages on my site, some with well over 100 images, with thumbnails generated using cropZoom. Every time I update Grav, it wipes out the images folder where the thumbnails are, and next time I load those pages it takes a very long time for all those thumbnails to be regenerated.

I'd like to see an option to set Grav so that it doesn't clear the images folder unless I explicitly tell it to. Perhaps be able to specify a permanent folder for the thumbnails to be stored in?

nicede avatar Aug 04 '21 07:08 nicede

something like this?

https://github.com/getgrav/grav/blob/b3af6c992011734b5f8ddd6480de595c0d0a3e74/system/config/system.yaml#L99

rhukster avatar Aug 04 '21 21:08 rhukster

I've gone and made sure this is set to false, I'll report back next time there's a Grav update.

nicede avatar Aug 04 '21 23:08 nicede

@rhukster, setting system.cache.clear_images_by_default is being used in Grav/Common/Cache::clearCache(), but only when clearCache() is being called with parameter $remove having value default.

Command $ bin/grav cache works as expected when setting system.cache.clear_images_by_default to true or false.

However, when Grav is being updated, Grav/Installer/Install::finalize() calls Cache::clearCache('all');. Hence the images folder is being wiped out no matter the setting for system.cache.clear_images_by_default

pamtbaau avatar Aug 05 '21 15:08 pamtbaau

So before each update, I will back up the images folder.

dallaslu avatar Aug 25 '21 04:08 dallaslu

Just updated my site to 1.7.9 through the Admin Panel. The images folder still seems to have been wiped, resulting in extremely long load times on my gallery pages.

nicede avatar Sep 01 '21 03:09 nicede

Updates do a full cache clear.

rhukster avatar Sep 01 '21 03:09 rhukster

I tend to agree here, I cannot remember the last time when Grav update has changed existing images. Images are a special case of cache -- I would exclude them.

mahagr avatar Sep 01 '21 07:09 mahagr

I wonder, due to which changes in Grav do existing folder structures and images in /images become unusable and must therefor be wiped?

  • Is there a change in Grav for which the folder structure need to be changed?
  • I can't think of a reason a browser can no longer load existing images from /images (unless the folder structure changes)
  • A change in image library makes sense in order to (optionally?) re-optimise cached images, but otherwise...

pamtbaau avatar Sep 01 '21 07:09 pamtbaau

Any news to share on this issue? A user on Discourse is having trouble with 2GB of images...

pamtbaau avatar Oct 25 '21 07:10 pamtbaau