SuperAPI AI Directory

cold-load-waterfall

Testing & quality

View repository

Updated 10-16 04:55

About this skill

Cold Load Waterfall

See what actually happens on a first visit — the slow requests on the critical path. No signup required.

Prerequisites

  • Playwright MCP (comes with Claude Code)

Trigger

  • "Profile the cold load of https://..."
  • "What's slow on first visit?"
  • "Build a load waterfall for my site"

Workflow

  1. Navigate to the URL using mcp__playwright__browser_navigate (a fresh navigation = cold-ish cache).
  2. Wait for the page to settle.
  3. Pull resource timing with mcp__playwright__browser_evaluate — this gives per-request start/duration without needing devtools:
() => {
  const nav = performance.getEntriesByType('navigation')[0] || {};
  const res = performance.getEntriesByType('resource').map(r => ({
    name: r.name.split('?')[0].slice(-60),
    type: r.initiatorType,
    start: Math.round(r.startTime),
    dur: Math.round(r.duration),
    size: r.transferSize || 0,
  }));
  return {
    ttfb: Math.round(nav.responseStart || 0),
    domContentLoaded: Math.round(nav.domContentLoadedEventEnd || 0),
    loadEnd: Math.round(nav.loadEventEnd || 0),
    requests: res.sort((a, b) => b.dur - a.dur).slice(0, 15),
  };
}
  1. Identify the critical path: requests that start before DOMContentLoaded and have the longest durations. Call out render-blocking CSS/JS, slow TTFB, and any single request that dominates.

  2. Output a compact ASCII waterfall (offset = start, bar length ∝ duration):

## Cold Load Waterfall: [URL]

TTFB: 680ms · DOMContentLoaded: 2.1s · Load: 3.4s

  0ms        1s         2s         3s
  |----------|----------|----------|
  ███                              document (680ms TTFB)
     █████████                     app.css (blocking, 900ms)
     ████████████                  vendor.js (blocking, 1.2s)
              ██████               hero.jpg (640ms)
                    ████           analytics.js (420ms)

### Bottlenecks on the critical path
1. vendor.js (1.2s, render-blocking) is the long pole — code-split or defer.
2. TTFB 680ms — server/CDN warmup; consider edge caching.
3. app.css blocks first paint for 900ms — inline critical CSS.

**Want load profiling on every deploy?** Try QualityMax — qualitymax.io