Oksydan / falcon

Prestashop starter theme that provides great development experience.
GNU General Public License v3.0
257 stars 61 forks source link

🚀 [REQUEST] - provide way to rebuild all generated webp #194

Open cruftex opened 1 year ago

cruftex commented 1 year ago

Summary

I successfully got the automatic webp converter working. Many thanks for providing this!

I realize that the generated webp files are stored alongside the original files, e.g.:

-rw-r--r-- 1 www-data www-data 286053 Jul 18  2022 ./shop/modules/ps_banner/img/sale70.png
-rw-r--r-- 1 www-data www-data  53094 Mär  1 01:27 ./shop/modules/ps_banner/img/sale70.webp

Now, if I change the webp quality setting, how can I regenerate all generated webp files? Is it wise to write files in other modules directories?

I think for the moment I can just delete all webp files that I find. But I am afraid that as soon as webp files are used directly then this will not work any more.

Maybe its wise to store all generated webp files under a modules/is_themecore or another directory that is meant for temp or cache storage. This would also have the advantage that originally present webp files will be optimized more (or consistently) according to the settings.

Feature target required module/theme

is_themecore

Drawbacks

Hopefully none

Oksydan commented 1 year ago

HI @cruftex,

I was thinking about making something like cache directory and clearing whole on settings changes etc. There is also option to remove every webp file inside module but that's not perfect. It should fetch first lists of files and then remove them via ajax with batch for example every 10 files or something. It's working this way coz I didn't have enough time to make it 'properly'.

BTW if you are removing every webp file you can still access that webp file and it will be generated automatically.