Skip to Content
High Performance Images
book

High Performance Images

by Colin Bendell, Tim Kadlec, Yoav Weiss, Guy Podjarny, Nick Doyle, Mike McCall
November 2016
Intermediate to advanced
354 pages
8h 39m
English
O'Reilly Media, Inc.
Content preview from High Performance Images

Chapter 12. Client Hints

Responsive images solve the problem of art direction, variable widths (including DPR changes), and alternate formats. While they provide a lot of flexibility, following all the best practices can result in very large amount of boilerplate HTML. (See “2014 Responsive Images HTML Spec” to see how this plays out in practice.) This approach is prone to error and exposes details on how you generate your images that can be exploited by bots.

Additionally, responsive images don’t help to address websites where we can’t control the HTML (such as many CMS platforms) or help with native applications that request images over HTTP but don’t use HTML for the UI.

Client Hints takes responsive images to the next level using content negotiation. This helps separate the delivery from the presentation. Client Hints is a standard that utilizes HTTP to negotiate between the browser and the server—just as we do for Gzip compression. With Gzip compression, the client tells the server that it is smart enough to decompress content (Accept-Encoding: gzip) and the server responds, with compressed content (Content-Encoding: Gzip). For example, the server could decide to compress CSS, but not Gzip WOFF (because WOFF is already Gzipped internally). It’s a nod and a wink between the browser and server to get bits across the network faster. The web developer and end user don’t have to worry about these details; they just know it results in a better user experience.

For ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Optimizing images

Optimizing images

Lara Callender Hogan
What Employees Want Most in Uncertain Times

What Employees Want Most in Uncertain Times

Kristine W. Powers, Jessica B.B. Diaz
Responsive & Fast

Responsive & Fast

Guy Podjarny
Image Processing and Acquisition using Python, 2nd Edition

Image Processing and Acquisition using Python, 2nd Edition

Ravishankar Chityala, Sridevi Pudipeddi

Publisher Resources

ISBN: 9781491925799Errata Page