16.03.2017 Views

Learning HTTP/2

akamai-learning-http2-preview-edition

akamai-learning-http2-preview-edition

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Figure 4.6 - Average RWD bytes served per pixel. Source: http://goo.gl/6hOkQp<br />

Image overloading mitigations involve the serving of tailored image sizes and quality,<br />

according to the user device, network conditions and the expected visual quality.<br />

Anti-Patterns<br />

Because <strong>HTTP</strong>/2 will only open a single connection per hostname, some <strong>HTTP</strong>/1.1<br />

best practices are turning into anti-pattern for <strong>HTTP</strong>/2. We list below some popular<br />

methods that no longer apply to <strong>HTTP</strong>/2 enabled websites<br />

Spriting and resource consolidation/inlining<br />

Spriting aims at consolidating many small images into a larger one in order to only<br />

incur one resource request for multiple image elements. For instance, color swatches<br />

or navigation elements (arrows, icons …) get consolidated into one larger image,<br />

called a sprite. In the <strong>HTTP</strong>/2 model, where a given request is no longer blocking and<br />

many requests can be handled in parallel, spriting becomes moot from a performance<br />

standpoint and website administrators no longer need to worry about creating them,<br />

although it is probably not worth the effort to undo them.<br />

In the same vein, small text-like resources like JS and CSS are routinely consolidated<br />

into single larger resources, or embedded into the main html, so as to also reduce the<br />

number of connections client-server. One negative effect is that a small CSS or JS,<br />

which may be cacheable on its own, may become inherently uncacheable if embedded<br />

in an otherwise non-cacheable html, so such practices should be avoided when a site<br />

migrates from <strong>HTTP</strong>/1.1 to <strong>HTTP</strong>/2. However, a study published by khanaca‐<br />

Anti-Patterns | 21

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!