Jump to content

How to upload webp files


Recommended Posts

  • 3 weeks later...
  • 2 weeks later...
En 21/4/2020 a las 4:33 PM, Thommen dijo:

When uploading product files in webp format, I have

How can I upload webp files to PrestaShop 1.7?

Hi thomman, thanks for your help, your link say buy a prestashop modul?? Any free modul for it?? 

Link to comment
Share on other sites

  • 7 months later...
On 5/19/2020 at 3:54 PM, Thommen said:

This is a CLI command that you enter after connecting via SSH. You can set it in crontab to automatically search and replace image files. Remember that the command is for PNG files. You can extend it with additional extensions. The host must support cwebp from →  https://developers.google.com/speed/webp

can please give more details on private message. thank you.

Link to comment
Share on other sites

  • 1 year later...
  • 3 weeks later...
  • 3 months later...

Hi,

Thanks to NicolasV for the solution. Answered for me in Prestashop 1.6. you have to do is change the code mentioned in .htaccess, put the webp read code of the web server and delete the PrestaShop cache once. Good luck

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...
  • 3 weeks later...
  • 1 month later...
On 8/21/2022 at 2:41 PM, NicolasV said:

I think it's worth a try, especially since the solution I implemented is in production on a 1.7 (and working).

I tried your solution in version 1.7.8.7 but it doesn't work. I also tried clearing the cache but nothing. Do you have any suggestions?
Thanks in advance ;) 

Link to comment
Share on other sites

On 9/11/2022 at 10:52 PM, Nickz said:

In case of having a shop which actually works, stick to jpg as long as webP is not 100% accepted in all browsers. WebP is from Google, a format from Google I'd not advice to use, same goes with Google Fonts. Just mediums to spy on us.

If you are a seller, switching to WebP might be a big factor in getting your site load times better (depending on what format was used earlier) and ranking better in Google CWV's which again can be ntoceable amount of added revenue. Also JPG's don't support transparency which is why many use PNG and the diference between PNG an WebP is significant.

Link to comment
Share on other sites

  • 3 months later...

Hey everyone,

I know this is an old topic, but it's the first result on Google.

From my experience, editing the core is generally a bad idea

- it messes up the future upgrades

- in this specific case, the proposed solutions, as @Nickz fairly pointed out above, may not be 100% compatible with all browsers

On 9/11/2022 at 2:52 PM, Nickz said:

In case of having a shop which actually works, stick to jpg as long as webP is not 100% accepted in all browsers. WebP is from Google, a format from Google I'd not advice to use, same goes with Google Fonts. Just mediums to spy on us.

(While I agree with the point about Google collecting as much data as they can, the webp unlike fonts is not hosted on Google servers, and instead is a yet another file on our servers, so shouldn't be a problem?)

So what I think could be a good way out is, as they say, "graceful fallback", as described here:

https://serverfault.com/questions/630212/conditionally-serving-high-resolution-and-webp-images-with-nginx

https://alexey.detr.us/en/posts/2018/2018-08-20-webp-nginx-with-fallback/

For it to work you will have to have your shop served on a proper server with Nginx and have basic understanding of how to configure it. I won't copy the whole thing here, but the general idea is

- you run a command (or schedule a script) to generate and have *.webp files alongside your regular images

- you configure the webserver to look at the accept header coming from the client's browsers: if webp is mentioned there, then it serves the webp copy, otherwise business as usual

We have done it like this in our shop and it's been running perfect for well over a year. Kudos to whoever came up with the idea first! (I would give a better credit if I could figure out who it was.)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...