vuestorefront / vue-storefront-api

Vue.js storefront for Magento2 (and not only) - data backend
https://www.vuestorefront.io
MIT License
348 stars 338 forks source link

add webp support for local image action #526

Closed gibkigonzo closed 3 years ago

gibkigonzo commented 3 years ago

Closes: #409

Fifciu commented 3 years ago

Shouldn't we check Accept header if it contains image/webp and if so - try to serve it? If not we could fallback to default one.With that, we could speed up pwa's with 0 changes in pwa code. We could make this a configurable option.

didkan commented 3 years ago

@Fifciu I'm wondering if that could be a potential cache problem. If Accept Header image/webp support is not part of the cache key then non-webp browsers could be served webp images, no? Or the other way around depending on which browser type (webp vs non-webp) that populates the cache for the given image.

This can of course be handled but would potentially inflate the total cache size for images since two version of each image needs to be cached, right?

gibkigonzo commented 3 years ago

@Fifciu @didkan I've made update. Now it checks accept header and also I've added webp to cache key. So we will have both files cached.

netzkollektiv commented 2 years ago

good change from 1 1/2 years ago @gibkigonzo, but unfortunately not merged in any version. when is this going to happen?

Thanks!

gibkigonzo commented 2 years ago

@netzkollektiv it is feature, so probably that's why it wasn't released in hotfixes. I think it is still valid, so maybe it can be released in some version, wdyt? @Fifciu