-
-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Webp images not being generated if cached jpg does not exist yet #70
Comments
I made a PR #74, it looks ok in dev mode. |
I can confirm this error exists to. Edit: PHP 7.3.25 |
Thanks for reporting this. I hope to look into the PR shortly (next week). @ssmadsen90 Hmm, are you really investing time into performance optimization, if your PHP version is this old and already removed from support by the PHP project since January last year? https://www.php.net/supported-versions.php Also note that PHP 7.1 is not supported by Magento, so it kind of makes sense to upgrade PHP ASAP instead of spending time on other optimizations https://devdocs.magento.com/guides/v2.3/install-gde/system-requirements.html#:~:text=Magento%20supports%20PHP%207.4.,is%20not%20tested%20or%20recommended. |
And @gtlt thanks so much for the PR itself :) |
@jissereitsma |
@ssmadsen90 Thanks for the update - sorry for being so picky about this, but with PHP 7.1 it would have seemed a waste. |
@jissereitsma No need at all. Thanks for paying attention to it :-) |
@gtlt The PR is committed and a new release is made. Everyone, could you test this? |
@jissereitsma |
@jissereitsma Seems working here 👍 |
@ssmadsen90 @gtlt @jissereitsma, Running on:
I don't think the original question / bug isn't resolved yet. When you flush your catalog images cache (so the cache folder is cleared) and you clear your cache once, the images on the frontend are served in the original file format instead of serving the WebP images. When you have full page cache enabled, varnish will serve the output and the logic of generating the WebP images will never be triggered again. The fact that the WebP generation works, is because the cache files are being generated while saving the images in the backend and the cache keys of the corresponding categories and product are being cleared. I don't know if this is something that should be fixed, or that we just have to leave the "Flush Catalog Image Cache" button alone :) |
This ticket has gone cold. To maybe reiterate, the following story might simulate the same issue: First of all, the Full Page Cache would need to be enabled (with or without Varnish) and a specific page (like a category page) would need to be reloaded, so that the cache is warm. Next, the folder Isn't therefore it more logical to say that the image generation command should also generate WebP images? Unfortunately, that's not easy to do. And it raises the question whether it is not smarter to generate all WebP images offline by using another (faster) tool (like something based on Node). My 50 cents after 2 years. |
Magento: 2.4.2
nextgenimages: 0.2.1
webp2: 0.10.5
When the
media/catalog/product/cache
folder is completely empty only Magento placeholders will be visible.I think this is because the original jpg does not exist yet.
When i open the image location in a new tab and change .webp to .jpg i'll get the correct jpg.
After this the .webp will also be properly generated.
A possible fix may be checking if the .jpg exists, if not either trigger it to generate the jpg or don't return the webp file so the jpg will be generated by the user request.
The text was updated successfully, but these errors were encountered: