Automating YSlow score using webpagetest, yslow command line and node js

The following is the sequence to generate the YSLOW score using script.

1. Create the environment

  • Install node js on RHEL :
    wget http://nodejs.tchol.org/repocfg/el/nodejs-stable-release.noarch.rpm
    sudo yum localinstall --nogpgcheck nodejs-stable-release.noarch.rpm
    sudo yum install nodejs-compat-symlinks npm
  • Install YSlow commandline as explained in http://developer.yahoo.com/yslow/commandline/
    sudo npm install yslow -g

    The following error is OK

    > contextify@0.1.2 install /usr/lib/node_modules/yslow/node_modules/jsdom/node_modules/contextify
    > node-gyp rebuild
    node.js:201
            throw e; // process.nextTick error, or 'error' event on first tick
                  ^
    Error: Cannot find module '/usr/lib/nodejs/npm/node_modules/node-gyp/bin/node-gyp.js'
        at Function._resolveFilename (module.js:332:11)
        at Function._load (module.js:279:25)
        at Array.0 (module.js:479:10)
        at EventEmitter._tickCallback (node.js:192:40)
    npm WARN optional dependency failed, continuing contextify@0.1.2
    /usr/bin/yslow -> /usr/lib/node_modules/yslow/bin/yslow
    yslow@3.1.0 /usr/lib/node_modules/yslow
    ├── commander@0.5.2
    └── jsdom@0.2.13

2. Get Key for accessing the webpagetest.org REST apis

  • Send mail to pmeenan@webpagetest.org with the following details
    • Purpose of the use
    • Number of API calls/day

3. Write script to get the HAR file from webpagetest.org and generate the Yslow file

Notes :

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: