Skip to content

Instantly share code, notes, and snippets.

@t32k
Last active April 29, 2023 14:56
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save t32k/6238713 to your computer and use it in GitHub Desktop.
Save t32k/6238713 to your computer and use it in GitHub Desktop.
Test a website's performance♪

Mastering WPT

WebPagetest - Website Performance and Optimization Test

  • Analytical Review
    • Test Location
    • Browser
    • Advanced Settings
  • Visual Comparison 'Dulles, VA - IE 9'
  • Mobile = Akamai's Mobitest
    • Select a device
    • Number of Tests to Run
    • Enable Video Capture?
    • Make Results Private?
  • Traceroute   + Test Location
    • Browser
    • Number of Tests to Run

Analytical Review Advanced Settings

Test Settings

  • Connection
    Custom: BW Down, BW Up, Latency, Packet Loss
  • Number of Tests to Run(Up to 9)
  • Repeat View (First View and Repeat View || First View Only)
  • Keep Test Private
  • Label

Advanced

  • Stop Test at Document Complete
    Typically, tests run until all activity stops.
  • Disable Javascript
  • Clear SSL Certificate Caches
  • Ignore SSL Certificate Errors
    e.g. Name mismatch, Self-signed certificates, etc.
  • Disable Compatibility View (IE Only) Forces all pages to load in standards mode
  • Capture network packet trace (tcpdump)
  • Save response bodies
    For text resources
  • Preserve original User Agent string
    Do not add PTST to the browser UA string
  • DOM Element(なにこれ?)
  • Minimum test duration
    Capture data for at least...

Chrome

  • Emulate Mobile Browser (Experimental)
    Chrome mobile user agent, 640x960 screen, 2x scaling and fixed viewport
  • Capture Dev Tools Timeline
  • Capture Network Log
  • Force Spdy version 3
  • Use SPDY without SSL
  • Force Software Rendering (disable GPU acceleration)
  • Disable Threaded HTML Parser
  • Command-line
    Custom options

Auth

HTTP Basic Authentication

PLEASE USE A TEST ACCOUNT! as your credentials may be available to anyone viewing the results. Utilizing this feature will make this test Private. Thus, it will not appear in Test History.

  • Username
  • Password

Script

Check out the documentation for more information on this feature

  • Enter Script
  • Script includes sensitive data
    The script will be discarded and the http headers will not be available in the results
  • Discard all HTTP headers

Block

  • Block ads (defined by adblockrules.org)
  • Block Requests Containing...
    Space separated list

SPOF

Simulate failure of specified domains. This is done by re-routing all requests for the domains to blackhole.webpagetest.org which will silently drop all requests.

  • Hosts to fail (one host per line)...

Video

Video will appear in the Screenshot page of your results

  • Capture Video

Metrics

  • Start Render
    The Start Render time is the first point in time that something was displayed to the screen. Before this point in time the user was staring at a blank page. This does not necessarily mean the user saw the page content, it could just be something as simple as a background color but it is the first indication of something happening for the user.

Start Render is the first point in time at which something other than a blank white page was displayed on the screen by the browser. It is measured by intercepting the browser's paint API calls.

  • DOM Content Loaded
    • domContentLoadedEventStart
    • domContentLoadedEventEnd
  • On Load
    • loadEventStart
    • loadEventEnd
  • Document Complete
    The metrics grouped together under the Document Complete heading are the metrics collected up until the browser considered the page loaded (onLoad event for those familiar with the javascript events). This usually happens after all of the images content have loaded but may not include content that is triggered by javascript execution.
  • Fully Loaded
    The metrics grouped together under the Fully Loaded heading are the metrics collected up until there was 2 seconds of no network activity after Document Complete. This will usually include any activity that is triggered by javascript after the main page loads.

Navigation Timing

timing-overview

http://www.w3.org/TR/navigation-timing/

Documents

API


@t32k
Copy link
Author

t32k commented Aug 27, 2013

Stop Test at Document Complete

domCompleteが近い。

@t32k
Copy link
Author

t32k commented Aug 27, 2013

Preserve original User Agent string

http://www.webpagetest.org/forums/showthread.php?tid=570

WPTのテストトラフィックをGoogleアナリティクスに記録させないために、デフォルトでWPTのテストユーザーエージェントにはPTSTというUAにしているらしい。それを解除するフラグ。

@t32k
Copy link
Author

t32k commented Aug 27, 2013

Script test

navigate  www.ca-girlstalk.jp/category_new
setUserAgent  Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X; ja-jp) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5376e Safari/8536.25     

@t32k
Copy link
Author

t32k commented Aug 27, 2013

DOM Elementは setDomElementの設定を書けばいいと思う。

@t32k
Copy link
Author

t32k commented Aug 28, 2013

DOM Content Loaded イベントは長い、幅のあるもの(onLoadも)。
DOM Content Loaded イベントに重い処理かいたらdomCompleteは遅れる。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment