ampproject / ampproject/amp-toolbox

[optimizer] Improve srcset generation

Open
#804 0 comments 0 reactions 0 assignees View on GitHub
enhancement toolbox-optimizer
Dominant language
HTML
Stars
459
Forks
242
PR merge metrics
No merged PRs in 30d

Description

The current algorithm generates three srcset sources from this list:

```
const SRCSET_WIDTH = [39, 56, 82, 100, .., 2500];
```

Starting at the image width X and picking the next two versions with twice the resolution from the list (> 2 * X and > 3 * X). This does not always make sense. For example:

* intrinsic layout: width defines the maximum width of the image, so we should also provide a smaller version.
* responsive layout: if the given height is small (e.g. for a mobile device screen) it might make sense to generate more than three larger versions.

More investigation needed.

//cc @patrickkettner

Contributor guide

Open the contributing guide

Research direction

No implementation file, test, or entry point is named. Locate the code that selects the three srcset widths, then investigate intrinsic and responsive layout cases against the current SRCSET_WIDTH list. The issue needs a decided algorithm and acceptance criteria before completion can be judged.

Written by the indexing model from the issue text.

Assessment

Domain
performance
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.