Learning HTTP/2
A Practical Guide for Beginners
Stephen Ludin and Javier Garza
Download from finelybook www.finelybook.com
2
Learning HTTP/2
by Stephen Ludin and Javier Garza
Copyright © 2017 Stephen Ludin, Javier Garza. All rights reserved.
Printed in the United States of America.
Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North,
Sebastopol, CA 95472.
O’Reilly books may be purchased for educational, business, or sales
promotional use. Online editions are also available for most titles
(http://oreilly.com/safari). For more information, contact our
corporate/institutional sales department: 800-998-9938 or
corporate@oreilly.com.
Acquisitions Editor: Brian Anderson
Editors: Virginia Wilson and Dawn Schanafelt
Production Editor: Shiny Kalapurakkel
Copyeditor: Kim Cofer
Proofreader: Sonia Saruba
Indexer: Wendy Catalano
Interior Designer: David Futato
Cover Designer: Karen Montgomery
Illustrator: Rebecca Demarest
June 2017: First Edition
Download from finelybook www.finelybook.com
3
Revision History for the First Edition
2017-05-14: First Release
See http://oreilly.com/catalog/errata.csp?isbn=9781491962442 for release
details.
The O’Reilly logo is a registered trademark of O’Reilly Media, Inc. Learning
HTTP/2, the cover image, and related trade dress are trademarks of O’Reilly
Media, Inc.
While the publisher and the authors have used good faith efforts to ensure that
the information and instructions contained in this work are accurate, the
publisher and the authors disclaim all responsibility for errors or omissions,
including without limitation responsibility for damages resulting from the use
of or reliance on this work. Use of the information and instructions contained
in this work is at your own risk. If any code samples or other technology this
work contains or describes is subject to open source licenses or the
intellectual property rights of others, it is your responsibility to ensure that
your use thereof complies with such licenses and/or rights.
978-1-491-96244-2
[LSI]
Download from finelybook www.finelybook.com
4
Preface
HTTP/2, also called h2 for simplicity, is a major revision of the HTTP
network protocol used by the World Wide Web, meant to improve the
perceived performance of loading web content.
Since HTTP/1.1 (h1) was approved in 1999, the web has changed significantly
from mostly text-based web pages that weighed a few kilobytes and included
less than 10 objects, to today’s media-rich websites that weigh on average
over 2 megabytes,
1
and include an average of 140 objects. However, the HTTP
protocol used to deliver the web content did not change in the intervening
years, making room for a new industry of Web Performance experts who
specialize in coming up with workarounds to help the aging protocol load web
pages faster. People’s expectations for performance have changed too — while
in the late ’90s people were willing to wait up to seven seconds for a page to
load, a 2009 study by Forrester Research found that online shoppers expected
pages to load under two seconds, with a large share of users abandoning sites
where pages take over three seconds to load. A recent study by Google showed
that a even a delay of 400 milliseconds (the blink of an eye) will cause people
to search less.
That’s why h2 was created — a protocol that can better handle today’s
complex pages without sacrificing speed. HTTP/2’s adoption has been
increasing
2
as more website administrators realize they can improve the
perceived performance of their websites with little effort.
We all use h2 every day — it powers some of the most popular sites like
Facebook, Twitter, Google, and Wikipedia — but many people don’t know
about it. Our goal is to educate you on h2 and its performance benefits, so you
can get the most out of it.
Download from finelybook www.finelybook.com
5