• Stars
    star
    1,204
  • Rank 38,902 (Top 0.8 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created almost 9 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Clear Eyes. Full Hearts. Can’t Lose.

The coach

Build status Stars

Documentation | Changelog

The coach

The coach helps you find performance problems on your web page. You can think of the coach as a modern version of YSlow.

Does my page need coaching?

You know, it's hard to get everything right! Some of the previous performance best practices are now worst practices. The coach will detect that the page is accessed using HTTP/2, and adjust its advice accordingly.

Why we love the coach

Ten reasons why we love the coach:

  • The coach gives you advice on how to make your page faster. The coach aims to NEVER give you bad advice. Follow the advice and you will WIN!
  • The coach uses real browsers to see your page exactly like your users do.
  • Every advice has one or more unit-tests to make sure it's easy to change advice in the future.
  • The coach knows about more than just performance: Accessibility and web best practice are other things that the coach can help you with.
  • You can integrate the coach with your own web performance tool. It's easy: your tool only need to be able to run JavaScript in the browser and produce a HAR file. Or you can use the built-in functionality of the coach to run the browser.
  • The coach is open-source. The advice is public, you can check it and change it yourself. Help us make the coach even better!
  • The coach can combine knowledge from the DOM with HAR to give you super powerful advice.
  • The CLI output is pretty nice. You can configure how much you want to see. Use it as fast way to check the performance of your page.

How to use the coach

You can use the coach in a few different ways.

Docker

docker run sitespeedio/coach https://www.sitespeed.io

To build a docker image from source you will need to run one command

docker build -t my-custom-coach .

Standalone

You need Node.js LTS (you need to be on 12 or later). And you need Chrome and/or Firefox installed.

If you want to use Chrome (Chrome is default):

webcoach https://www.sitespeed.io

Try it with Firefox (needs Firefox 57 or later):

npm install webcoach -g
webcoach https://www.sitespeed.io --browser firefox

If you also want to show the offending assets/details and the description of the advice:

webcoach https://www.sitespeed.io --details --description

By default, the coach only tells you about advice where you don't get the score 100. You can change that. If you want to see all advice, you can do that too:

webcoach https://www.sitespeed.io --limit 101

If you want to test as a mobile device, that's possible too, by faking the user-agent.

webcoach https://www.sitespeed.io --mobile -b chrome

... but hey, I want to see the full JSON?

Yes, you can do that!

webcoach https://www.sitespeed.io -f json

This will get you the full JSON, the same as if you integrate the coach into your tool.

... but hey, I don't want any color in the table output?

That's possible as well!

webcoach https://www.sitespeed.io --noColor

Include in your own tool

The coach uses Browsertime to start the browser, execute the JavaScript and fetch the HAR file. You can use that functionality too inside your tool or you can use the raw scripts if you have your own browser implementation.

Use built in browser support

In the simplest version you use the default configuration (default DOM and HAR advice and using Firefox):

const api = require('webcoach');
const result = api.run('https://www.sitespeed.io');

The full API method:

// get the API
const api = require('webcoach');
const result = api.run(url, domScript, harScript, options);

Use the scripts

Checkout the coach-core module.

What does the coach do

The coach will give you advice on how to do your page better. You will also get a score between 0-100. If you get 100 the page is great, if you get 0 you can do much better!

How does it all work?

The coach tests your site in two steps:

  • Executes JavaScript in your browser and check for performance, accessibility, best practice and collect general info about your page.
  • Analyze the HAR file for your page together with relevant info from the DOM process.

You can run the different steps standalone but for the best result run them together.

What the coach does

Bonus

The coach knows more than just performance. She also knows about accessibility and web best practice.

Accessibility

Make sure your site is accessible and usable for everyone. You can read more about making the web accessible here.

Best practice

You want your page to follow best practices, right? Making sure your page is set up for search engines, have good URL structure and so on.

Privay

Make sure that your page respect user privacy.

General information

The world is complex. Some things are great to know but hard for the coach to give advice about.

The coach will then just tell you how the page is built and you can draw your own conclusions if something should be changed.

Timings

The coach has a clock and knows how to use it! You will get timing metrics and know if you are doing better or worse than the last run.

Developers guide

Checkout the developers guide to get a better feeling how the coach works.

Browser support

The coach is automatically tested in latest Chrome and Firefox. To get best results you need Chrome or Firefox 48 (or later) to be able to know if the server is using HTTP/2.

We hope that the coach works in other browsers but we cannot guarantee it right now.

More Repositories

1

sitespeed.io

sitespeed.io is an open-source tool for comprehensive web performance analysis, enabling you to test, monitor, and optimize your website’s speed using real browsers in various environments.
JavaScript
4,716
star
2

browsertime

Measure and Optimize Web Performance
JavaScript
602
star
3

throttle

Throttle your network connection [Linux/Mac OS X]
JavaScript
332
star
4

chrome-har

Create HAR files from Chrome Debugging Protocol data
JavaScript
138
star
5

compare

Compare HAR files.
JavaScript
110
star
6

pagexray

Xray your HAR file and know all about the page
JavaScript
83
star
7

grafana-bootstrap-docker

Shell
60
star
8

sitespeed.io-docker

Shell
52
star
9

dashboard.sitespeed.io

Example how to use sitespeed.io to monitor the performance of your web site
JavaScript
45
star
10

jenkins.sitespeed.io

A Jenkins plugin for sitespeed.io
Java
31
star
11

grunt-sitespeedio

Test performance budgets and performance best practice rules using sitespeed.io
JavaScript
28
star
12

plugin-lighthouse

Lighthouse plugin for sitespeed.io
JavaScript
26
star
13

chrome-trace

Process Chrome trace logs in Node.
JavaScript
14
star
14

plugins

List of 3rd party plugins for sitespeed.io
10
star
15

run.sitespeed.io

Online version of sitespeed.io
JavaScript
9
star
16

docker-browsers

Dockerfile
8
star
17

plugin-gpsi

GPSI plugin for sitespeed.io
JavaScript
7
star
18

humble

Raspberry Pi WiFi network link conditioner
6
star
19

plugin-third-party-decode

Run Paul Irish Third Party Decode library to categorise third parties
JavaScript
5
star
20

chromedriver

Install and launch Chromedriver for Mac, Linux or Windows.
JavaScript
4
star
21

sltc

JavaScript
4
star
22

browsertime-extension

Extension that runs in Firefox/Chrome to get some extra fire for Browsertime
JavaScript
3
star
23

logo

All the logos for sitespeed.io
3
star
24

plugin-webpagetest

sitespeed.io plugin for running WebPageTest
JavaScript
2
star
25

travis

Example repo for using sitespeed.io budget using Travis
HTML
2
star
26

docker-node

Base Docker container for sitespeed.io with Ubuntu & NodeJS
Dockerfile
1
star
27

raspberrypi

Pre-made raspberry pi image to drive Android phones
1
star
28

geckodriver

Install and launch Geckodriver for Mac, Linux or Windows.
JavaScript
1
star