2

I'm wondering how to use webp in amp correctly. There is a sample form amp doc

<amp-img alt="Mountains"
width="550"
height="368"
layout="responsive"
src="images/mountains.webp">
<amp-img alt="Mountains"
    fallback
    width="550"
    height="368"
    layout="responsive"
    src="images/mountains.jpg"></amp-img>
</amp-img>

But this waste with bandwidth for non-webp browsers. A non-webp browser will download both images, first the webp, then failing to decode it, and download the jpg.

I know the AMP Cache does do webp transcoding automatically for webp capable browsers, but this doesn't help on my own origin or in other viewers.

There is also issue Add mechanism for selecting image file based on capability, but it's inactive for two years.

Is there any better solution for this?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Marv
  • 441
  • 2
  • 14

0 Answers0