ampproject / ampproject/amphtml
Add mechanism for selecting image file based on capability
- Dominant language
- JavaScript
- Stars
- 14.9k
- Forks
- 4.1k
- PR merge metrics
- No merged PRs in 30d
Description
[WebP](https://developers.google.com/speed/webp/) images are not supported on all browsers, but can be enabled per browser as a means of reducing bytes on the wire.
In the case of the AMP Cache, the origin can't respond selectively with different image types based on the browser request headers, so the decision of image variant would need to be something the browser selects.
With a `` tag, this is possible outside of AMP, ie:
```

```
However, AMP doesn't seem to have anything similar with ``.
Contributor guide
Research direction
Start by reviewing the existing amp-img behavior and the issue's picture example, then investigate how AMP components handle browser capability selection when served through the AMP Cache. Done means an AMP-supported mechanism lets browsers choose WebP when available and use the JPEG fallback otherwise.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100