Using WebPageTest 1st Edition Rick Viscomi download
Using WebPageTest 1st Edition Rick Viscomi download
download
https://ebookfinal.com/download/using-webpagetest-1st-edition-
rick-viscomi/
https://ebookfinal.com/download/rick-steves-pocket-vienna-2nd-edition-
rick-steves/
https://ebookfinal.com/download/rick-steves-2005-best-of-europe-rick-
steves-best-of-europe-rick-steves/
https://ebookfinal.com/download/rick-steves-amsterdam-bruges-and-
brussels-seventh-edition-rick-steves/
https://ebookfinal.com/download/rick-sammon-s-hdr-secrets-for-digital-
photographers-rick-sammon/
Rick Steves Prague and the Czech Republic 5th Edition Rick
Steves
https://ebookfinal.com/download/rick-steves-prague-and-the-czech-
republic-5th-edition-rick-steves/
https://ebookfinal.com/download/essential-sqlalchemy-1st-edition-rick-
copeland/
https://ebookfinal.com/download/face-to-face-rick-sammon-s-complete-
guide-to-photographing-people-1st-edition-rick-sammon/
https://ebookfinal.com/download/professional-oracle-programming-1st-
edition-rick-greenwald/
https://ebookfinal.com/download/mysql-crash-course-rick-silva/
Using WebPageTest 1st Edition Rick Viscomi Digital
Instant Download
Author(s): Rick Viscomi, Andy Davies, Marcel Duran
ISBN(s): 9781491902592, 1491902590
Edition: 1
File Details: PDF, 6.02 MB
Year: 2015
Language: english
Using WebPagetest
Boston
Using WebPagetest
by Rick Viscomi, Andy Davies, and Marcel Duran
Copyright © 2010 Rick Viscomi, Andy Davies and Marcel Duran. 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://my.safaribooksonline.com). For more information, contact our corporate/
institutional sales department: 800-998-9938 or corporate@oreilly.com.
Editors: Courtney Nash and Brian Anderson Indexer: FIX ME!
Production Editor: FIX ME! Cover Designer: Karen Montgomery
Copyeditor: FIX ME! Interior Designer: David Futato
Proofreader: FIX ME! Illustrator: Rebecca Demarest
Nutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo are registered trademarks of O’Reilly
Media, Inc. !!FILL THIS IN!! and related trade dress are trademarks of O’Reilly Media, Inc.
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as
trademarks. Where those designations appear in this book, and O’Reilly Media, Inc. was aware of a trademark
claim, the designations have been printed in caps or initial caps.
While every precaution has been taken in the preparation of this book, the publisher and authors assume
no responsibility for errors or omissions, or for damages resulting from the use of the information contained
herein.
ISBN: 978-1-491-90259-2
[?]
Table of Contents
Preface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vii
3. Cache Optimization. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Enabling Repeat View 34
Analyzing Cachability 36
Heuristic Caching 37
iii
4. Comparing Tests. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Perceived Performance 41
Capture Video 42
Filmstrip and Video 43
Speed Index 48
Summary 52
6. Mobile Testing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Desktop Emulation 75
Traffic Shaping 79
Native Devices 80
7. Scripting Preconditions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Flow View 84
logData and navigate 85
Authentication 86
HTTP Basic Authentication 87
DOM Manipulation 88
Setting Cookies 89
8. SPOF Testing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
Blackhole Rerouting 93
setDns 94
SPOF Tab 96
Blocking Requests 98
iv | Table of Contents
Simple example test 105
Advanced example test 107
Reading results 108
Polling test results 110
Pingback test results 111
Reading beyond results 112
Table of Contents | v
Configure and Launch AWS Instance 138
Creating your own local installation 140
Desktop Test Agents 142
Mobile Test Agents 146
Install NodeJS Agent 147
Add test devices 147
Bandwidth shaping 151
Remote Test Agents 152
Private Instance Only Features 153
Bulktest 153
Custom Metrics 155
Day-to-Day Management 155
Monitoring Queues and Test Agents 155
Archiving Old Tests 157
Updating an Instance 158
Troubleshooting 158
Contributing 160
Index. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
vi | Table of Contents
Preface
vii
speed of web pages. In this book, we will walk you through using this tool to test the
performance of web pages so that you can diagnose the signs of slowness and get your
users back on track.
1. Basic use cases provide a foundation of testing experience by explaining how to run
and interpret simple tests.
2. Intermediate use cases have a deeper focus on more sophisticated test scenarios,
some of which may require scripted commands to configure how the tests are ex‐
ecuted.
3. Advanced use cases describe lower-level capabilities typically required by special
test environments including the API and private instances.
viii | Preface
This icon indicates a warning or caution.
Preface | ix
ogy, and dozens more. For more information about Safari Books Online, please visit us
online.
How to Contact Us
Please address comments and questions concerning this book to the publisher:
We have a web page for this book, where we list errata, examples, and any additional
information. You can access this page at http://www.oreilly.com/catalog/<catalog page>.
To comment or ask technical questions about this book, send email to bookques
tions@oreilly.com.
For more information about our books, courses, conferences, and news, see our website
at http://www.oreilly.com.
Find us on Facebook: http://facebook.com/oreilly
Follow us on Twitter: http://twitter.com/oreillymedia
Watch us on YouTube: http://www.youtube.com/oreillymedia
x | Preface
PART I
Basic Use Cases
Imagine for a moment that you have been hired as the new assembly line foreman at
Gizmos & Doodads Incorporated, a company that manufactures highly desirable widg‐
ets. Your new boss tells you about how slow production has been; orders have been
taking twice as long to fulfill and the line has been unable to keep up with what is
otherwise a successful increase in business. Your job is to make sure that the line workers
can meet demand.
You outline a plan to not only meet demand but have the factory running at peak effi‐
ciency. The first step of your plan is to determine the current rate of production and set
goals to measure improvement. The second step will be to measure and fine tune the
efficiency of each phase of the operation. Step three, of course, is profit.
In order to find out the production speeds, you implement a widget counter system that
measures how quickly each unit is made. After a week of aggregating information, you
determine that the end-to-end time for manufacturing is half as fast as you need to be
to meet the quota. You’ve confirmed that there is indeed a problem in the performance
process, but you still don’t know why.
To understand what’s wrong, you move to the second step and analyze what each part
of the assembly line is doing. You inspect every station for inefficiencies and time how
long it takes until the task is completed. Contrary to the continuous collection of data
in the first step, this one is more like a snapshot of performance. With this new per‐
spective, you’re more easily able to see how the parts work together and take up time.
Armed with concrete performance data and a detailed breakdown of each stage of
widget production, you can see a path to reach the goal of doubling assembly speed. As
it turns out, the top and bottom pieces of the widget can be assembled independently
and combined at the end, halving the time it takes to build!
This plan is not so different from the way you would approach web performance opti‐
mization. After determining the actual speed of your web page, you get an idea of how
much faster it needs to be. Then you turn to a breakdown of what the page is actually
doing while it loads to figure out ways to achieve the necessary speedup required to
meet your goal. These two steps are distinct in methodology because they serve different
purposes: finding out how fast a page is and how to make it faster.
This section will approach the utility of WebPagetest from a beginner’s point of view,
starting by addressing a couple of ways in which it can be misused. The following chap‐
ters dive into the fundamental ways WebPagetest can be used to determine how to make
a page faster.
CHAPTER 1
“How fast is my page?”
The first question to pop into the minds of most people tasked with optimizing the
performance of a web page is probably “How fast is it?”. Like the story about the factory,
understanding the current state of a system is an important first step on the road to
optimization. Determining the current speed of a page helps to dictate the severity of
the performance problem and sets a baseline from which to improve.
Before diving into WebPagetest for the purpose of getting the one golden number that
represents the true speed of your page, take a step back and consider two cautionary
points. First, the golden number you seek may not be the metric provided by the tool.
If you want to know the speed of a page, you should define exactly what you’re trying
to measure. Second, even if the tool did report on the metric you care about, it is not
necessarily representative of the page’s true speed. The true speed is that which the real
users of the page experience. Real users live all over the world, use different technologies
like device type or browser, and connect to the Internet differently. The true speed of
this amalgamation is extremely hard to reflect in a single test.
3
For example, think about the last time you read a news article online. As the page loaded,
what were you waiting for? The most probable answer is that you were waiting for the
text content of the article itself. The DOMContentLoaded event, also reported by Web‐
Pagetest, is like the load event except that it doesn’t wait for images to be displayed. The
timing of this event may be a more appropriate metric to track because the time to load
the ancillary images should not necessarily be taken into account. The default metric is
not always the most relevant to the page in test.
For one final example, consider the YouTube video player page. This is not a traditional
web page and its content is more elaborate than just text and images. Sometimes, as in
this case, custom application-specific metrics are needed to represent the true load time.
Users of this page are waiting for the video to play, as opposed to the text appearing or
images loading. The page itself needs to tell the browser when the wait is actually over
because the built-in events aren’t designed for this particular use case of reporting when
the video starts playing.
Application-specific metrics
You can log custom application-specific metrics to WebPagetest with
the User Timing API. Using the YouTube example, when the video
starts to play, that moment in time can be marked with a line of
JavaScript:
performance.mark('playback-start');
WebPagetest will capture these marks and make them available in test
results.
Synthetic vs RUM
Web performance tools tend to be divided based on which big question they answer:
“How fast is it?” or “How to make it faster?”. The two classifications of tools are com‐
monly referred to as synthetic and real user monitoring (RUM). WebPagetest falls under
the synthetic category.
There’s a saying that when you have a hammer, all of your problems start to look like
nails. Similarly, no one type of web performance tool can answer all of your questions.
It’s important to distinguish what each type does and how it can be used so that you
know when to use the right tool for the job.
Synthetic
• laboratory-like testing
• low variability, controlled
• ad-hoc tests
Tools like WebPagetest are considered to be synthetic because of their artificial testing
environments. Akin to a clean room in a laboratory, WebPagetest gives its testers gran‐
ular control over many of the variables that contribute to performance changes, such
as geographic location and type of network connection. By making these variables con‐
stant, the root causes of poor front end performance can be more easily identified and
measured.
Unlike the control afforded by synthetic testing, RUM does what its name implies and
measures the actual performance real users are experiencing in the wild. The unbridled
variations in browsers and bandwidth are all accounted for in the tests so that each and
every user’s unique environment is represented. By looking at the raw data, definitive
statistical conclusions can be drawn. For instance, with access to the performance re‐
sults, you are able to determine the page load time for any given percentile. RUM is also
considered to be monitoring because data tend to be continuously recorded and
streamed to a dashboard. By monitoring performance, developers are able to get instant
notification when the page speed takes an unexpected turn; a decline in speed could
theoretically page an engineer immediately if necessary. This is especially useful for
mission critical applications in which performance is just as important as availability.
When attempting to determine the overall speed of a page, it’s clear that RUM is the
appropriate solution because it accurately represents the performance of actual users.
When starting out with WebPagetest, one pitfall is to assume that the synthetic results
are like real user metrics. The reality, however, is that synthetic tools are deliberately
designed to focus on the performance of a web page under strict conditions which are
otherwise highly volatile in real user performance.
To help illustrate this pitfall, imagine that you run a synthetic test of your home page
and come to find that the load time is ten seconds. “That’s crazy,” you think, because it
never feels that slow to you. Your real world experience does not coincide with the test
results. It’s not that the test is necessarily wrong. The test configuration is meant to
represent one particular use-case. If it isn’t set up to match your browser, in your city,
over your connection speed, you’re unlikely to get comparable results. The test is only
an artificial representation of what someone under similar conditions might experience.
It’s up to you to configure the test in a way that mimics the conditions that you want to
compare. Throughout the book, we’ll look at different use-cases that each have their
own unique conditions, which in turn have corresponding configurations.
Synthetic vs RUM | 5
CHAPTER 2
“What is slowing down my page?”
It’s good to know how fast a page is. Knowing how to make it faster is even better. To
be fair, knowing the change in performance over time is extremely important to vali‐
dating that the optimizations to the page are actually working. Before any optimizations
can be made, however, you need to understand how the page is put together and what
opportunities exist for optimization. To get there, this chapter will walk you through
the steps of running a very simple test and analyzing the results to figure out what exactly
is going on under the hood.
7
Figure 2-1. The default WebPagetest home page.
First, go to www.webpagetest.org. One of the most prominent parts of the page is the
great big text input field, with a prompt to “Enter a Website URL”. Let’s get started by
providing the web address of a page we want to test.
Figure 2-2. The URL field of the home page set to www.example.com.
Figure 2-3. The test has progressed to the second phase and is currently in the process of
being run.
WebPagetest is a publicly accessible tool, which implies that many people may be trying
to use it at the same time. The browser and location at which you run tests are shared
commodities and there may sometimes be a queue of tests backed up. This is the waiting
phase, when the resource you need is already in use and there may be more tests ahead
of you waiting for the same. This can be the most unpredictable phase because of two
factors: the variable number of tests ahead in the queue and the variable complexity of
the tests. Tests that do more require more time to complete. Having many of these kinds
of tests in the queue can slow down this phase to minutes or even hours. Sometimes, a
test can get stuck and nothing in the queue can move until an administrator becomes
available to sort it out.
THE END
TRANSCRIBER NOTES
1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside
the United States, check the laws of your country in addition to
the terms of this agreement before downloading, copying,
displaying, performing, distributing or creating derivative works
based on this work or any other Project Gutenberg™ work. The
Foundation makes no representations concerning the copyright
status of any work in any country other than the United States.
1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if
you provide access to or distribute copies of a Project
Gutenberg™ work in a format other than “Plain Vanilla ASCII” or
other format used in the official version posted on the official
Project Gutenberg™ website (www.gutenberg.org), you must,
at no additional cost, fee or expense to the user, provide a copy,
a means of exporting a copy, or a means of obtaining a copy
upon request, of the work in its original “Plain Vanilla ASCII” or
other form. Any alternate format must include the full Project
Gutenberg™ License as specified in paragraph 1.E.1.
• You pay a royalty fee of 20% of the gross profits you derive
from the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”
• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.
1.F.
Most people start at our website which has the main PG search
facility: www.gutenberg.org.
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebookfinal.com