Book Image

PhantomJS Cookbook

By : Rob Friesel
Book Image

PhantomJS Cookbook

By: Rob Friesel

Overview of this book

Table of Contents (15 chapters)
PhantomJS Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Executing a detailed performance analysis


This recipe introduces the YSlow library for PhantomJS and illustrates how to perform a detailed performance analysis of a web page.

Getting ready

To run this recipe, we will need a target URL.

We will use the PhantomJS port of the YSlow library to execute the performance analysis on our target web page.

Note

YSlow is a library that analyzes web pages and produces a report on that page's performance, grading it against benchmarks and rules established by Yahoo! web performance experts. We can find out more about YSlow for PhantomJS on the project site at http://yslow.org/phantomjs/.

The examples that follow assume version 3.1.8 of the YSlow library, which is included with the sample code repository.

YSlow is open source and distributed under the New BSD License.

Lastly, the script in this recipe runs against the demo site that is included with the book's sample code repository. To run that demo site, we must have Node.js installed. In a separate terminal...