Skip to content

Configuration

Webperf Core is controlled at three levels, where the more specific one wins.

Order of precedence

  1. Command line arguments: highest priority, applies to one run
  2. settings.json in the project root: your permanent choices
  3. defaults/settings.json: the project's defaults

You only need to state what you want to change. Everything else is inherited.

Temporary

python default.py -u https://example.com -t 15 -r \
  --setting tests.sitespeed.browser=firefox

All command line arguments

Permanent

{
  "general": {
    "language": "en",
    "review": {
      "show": true,
      "details": true
    }
  }
}

More about settings.json

Common settings

General

Setting Default Description
general.language en Report language (sv, en, da, fi, is, no)
general.request.timeout 60 Seconds before a request gives up
general.useragent A Firefox string Which browser the tests present themselves as
general.dns.address 8.8.8.8 DNS server used for lookups

Review

Setting Default Description
general.review.show false Show the review in the terminal. Same as the -r flag
general.review.details false A fuller review
general.review.data false Attach the raw data as JSON
general.review.improve-only true Show only what can be improved

Cache

Setting Default Description
general.cache.use false Reuse fetched content between runs
general.cache.folder cache Where the cache is stored
general.cache.max-age 60 Cache lifetime in minutes

The cache is worth turning on when you run several tests against the same site in a row. The page is then fetched once instead of once per test.

Per test

Each test has its own settings under tests., described on that test's page:

Prefix Test
tests.sitespeed. 15 – Performance (Sitespeed.io)
tests.page-not-found. 2 – 404 (Page not Found)
tests.a11y-statement. 26 – Accessibility Statement (Alfa)
tests.email. 24 – Email (Beta)
tests.http. 21 – HTTP & Network
tests.software. 25 – Software
tests.webbkoll. 31 – Privacy (Webbkoll)
tests.dns. 32 – DNS (Zonemaster)

List everything

python default.py --setting ?

This prints every setting with the value in force right now, including your own changes.

Keep your settings.json short

Include only what you want to change. That way you automatically pick up new defaults when the project updates them.