Before a Performance Release, Test HTTP 103 Early Hints Preload URLs

Test HTTP 103 Early Hints preload URLs against a hints-disabled page load, and investigate stale assets, redirects, and unused preloads before release.

Published
Reading time
8 min read
Before a Performance Release, Test HTTP 103 Early Hints Preload URLs
On this page

HTTP 103 Early Hints can tell a browser about resources before the final response arrives. That head start is useful only if the hints identify resources the page will actually use. After an asset rebuild or deployment, an old filename can turn an early preload into a redirect, a failed request, or an unnecessary download.

This tutorial shows how to test HTTP 103 Early Hints preload URLs against a page's requests with hints disabled, then investigate the mismatches before release.

Key Takeaways

  • A 103 response is informational; the final response still determines the page's status and content.
  • Compare hints with a baseline captured without 103 hints. Otherwise, an unused hinted asset can appear in the request list simply because it was hinted.
  • Check exact URLs, including origin and query string, as well as redirects, asset usage, and preload attributes.
  • Test through the production delivery path and in relevant browsers. Clients and intermediaries do not all handle 103 identically.

What Early Hints can and cannot do

A server or intermediary can send a 103 Early Hints response containing Link headers before the final response. For example, a link with rel=preload can identify a stylesheet or script that the client may begin fetching early. The client may also ignore the hint.

A hint is not proof that the final page uses an asset, that a preload will be reused, or that an earlier fetch will improve performance. A wrong hint can consume bandwidth and compete with useful requests. A redirect or error at the hinted URL can also negate the intended head start.

Verification limitation: RFC 8297 and the relevant official browser and server documentation were not retrieved for this article. Current browser, server, CDN, and intermediary support has therefore not been verified here. Before publishing or deploying, consult those primary sources for your exact versions and delivery path; do not assume all clients process 103 responses the same way.

Advertisement

Capture the 103 headers

Use a staging environment or another system you are authorized to test. Start with the exact page URL and request conditions that the release will serve. Set PAGE_URL to your own URL; the address below is only an example.

PAGE_URL='https://www.example.com/'
curl --http1.1 --silent --show-error --dump-header - --output /dev/null "$PAGE_URL"

Inspect the header dump for each HTTP/1.1 103 response and its Link fields, followed by the final response. Record the target URLs of links whose rel includes preload, along with their attributes, such as as and crossorigin. There can be multiple informational responses and multiple links. If you see no 103, that establishes only what happened for this request; configuration, protocol, cache state, or an intermediary may differ from a browser request.

The command does not follow redirects. That is deliberate: if the page URL redirects, inspect the redirect response and then repeat the capture for each destination, recording which request produced each hint. Resolve a relative link against the URL of the response carrying it. Do not assume that a hint on a redirect and a hint on the final page have the same base URL.

This HTTP/1.1 capture is a diagnostic starting point, not proof of what a browser receives over another protocol. Also inspect the browser-facing CDN or proxy path and, where your tools expose it, the browser's response information. Avoid putting credentials or sensitive query parameters in shared logs.

Capture a baseline without Early Hints

A useful comparison requires a page load that does not itself issue the 103 preloads:

  1. In an isolated staging configuration, disable 103 hints while keeping the final response, page content, asset manifest, and other settings as close as possible to the release configuration.
  2. Open a fresh browser profile or otherwise clear the relevant caches. Ensure a service worker is not serving different content or hiding network behavior. Record the browser, protocol, viewport, authentication state, and test conditions.
  3. Load the same page and exercise the user flows you intend to cover. Include responsive layouts, lazy-loaded content, and routes that matter to the release. Wait for relevant asynchronous requests to finish.
  4. Use the browser's Network panel to inspect requests, redirects, initiators, and failures. Save a network recording if your browser supports it.
  5. In the page's developer console, evaluate the following expression and save the resulting JSON array to a local file named baseline.json:
JSON.stringify(
  [...new Set(performance.getEntriesByType('resource').map(entry => entry.name))],
  null,
  2
)

Resource Timing is a convenient comparison list, not a complete usage audit. Its buffer can fill, and it does not tell you by itself whether a preload was consumed by the page. Browser tooling and collection settings can also affect what you see. Cross-check it against the Network panel, especially for redirects, late requests, failures, and large pages. Repeat the capture for each relevant scenario rather than treating one load as universal.

Keep final-response and HTML preloads enabled in the baseline if they are part of the actual release. However, their presence in the list still does not prove the page uses them; check their initiators and consumers separately.

Compare hints with the baseline

Create hints.json as a JSON array of the preload target URLs recorded from the 103 response for one page URL. Absolute and page-relative URLs are accepted. For example, this is an illustrative input file, not an observed response:

[
  "/assets/site.abc123.css",
  "/assets/app.def456.js"
]

For a redirect chain, compare each response's hints using that response's URL as the base, and evaluate them against the applicable final-page scenarios. Do not extract Link values by blindly splitting on commas: header parameters can make naive parsing misleading. Use a standards-aware parser or carefully transcribe the targets for this small diagnostic test.

Save the following as compare-hints.cjs. It compares normalized URL strings while retaining the origin, path, and query string. Fragments are removed because they are not sent as part of an HTTP request.

const fs = require('node:fs');

const [pageUrl, hintsPath, baselinePath] = process.argv.slice(2);
if (!pageUrl || !hintsPath || !baselinePath) {
  console.error('Usage: node compare-hints.cjs <page-url> <hints.json> <baseline.json>');
  process.exit(1);
}

function readArray(path) {
  const value = JSON.parse(fs.readFileSync(path, 'utf8'));
  if (!Array.isArray(value) || !value.every(item => typeof item === 'string')) {
    throw new Error(`${path} must contain a JSON array of strings`);
  }
  return value;
}

function normalize(value) {
  const url = new URL(value, pageUrl);
  if (url.protocol !== 'http:' && url.protocol !== 'https:') {
    throw new Error(`Unexpected URL scheme: ${url.protocol}`);
  }
  url.hash = '';
  return url.href;
}

try {
  const hints = [...new Set(readArray(hintsPath).map(normalize))];
  const baseline = new Set(readArray(baselinePath).map(normalize));
  for (const hint of hints) {
    console.log(`${baseline.has(hint) ? 'PRESENT IN BASELINE' : 'NOT IN BASELINE'}  ${hint}`);
  }
} catch (error) {
  console.error(error.message);
  process.exit(1);
}

With Node.js installed, run it using the URL that produced those hints:

node compare-hints.cjs "$PAGE_URL" hints.json baseline.json

The code in this article was not executed in this run. A match means the same normalized URL appeared in the baseline resource list; it does not prove the hinted response was successfully reused. A mismatch is a candidate for investigation, not automatically a defect: it might belong to another viewport, route, or user flow, or be missing from an incomplete capture.

Advertisement

Investigate mismatches and redirects

For each hinted URL, use the Network panel and your deployment's asset manifest to answer these questions:

  • Is the URL current? Compare the hint with the asset filenames produced by the same release. A content-hashed filename may change on each relevant build; an old hint may point to an obsolete file or a 404.
  • Does it redirect? Inspect the complete redirect chain and final status. An exact comparison can flag a hint that redirects to the resource the page requests. Prefer hinting the final intended URL when the deployment can provide it reliably, but confirm that the page and cache configuration agree.
  • Does the page actually use it? Inspect initiators and the page's stylesheet, script, font, or image usage. A request caused solely by a preload is not evidence of consumption. Remove hints for resources unnecessary in the covered scenarios, or scope them more narrowly.
  • Can the preload be reused? Compare the hinted URL and attributes with the eventual request. In particular, check as and cross-origin or credentials behavior; mismatches can prevent reuse or lead to an extra fetch. Verify the result in the browser rather than assuming a URL match is sufficient.
  • Is a different variant needed? Locale, authentication, experiments, device layout, query parameters, and deployment skew can change the asset set. Test representative variants and avoid sending a universal hint for an asset that only some pages use.

Then enable 103 again and repeat the browser test with comparable cache and service-worker conditions. Inspect whether the browser received the hint, what it requested, whether the eventual consumer reused the resource, and whether errors or duplicate transfers occurred. A controlled timing comparison can inform the release decision, but this checklist alone does not establish a performance improvement.

Common Mistakes

  • Comparing hints only with a hints-enabled load, which can make unused preloads look necessary.
  • Matching only filenames and ignoring origin, query strings, redirects, or changed build hashes.
  • Treating a successful request as proof that the final page consumed the resource.
  • Checking the origin server but not the CDN or proxy path that users actually reach.
  • Assuming a single browser, protocol, or cache state represents all clients.
  • Inferring current support from a historical specification without checking official documentation for deployed versions.

Best Practices

Generate or update hints from the same release data as the page's asset references, and deploy them consistently across the origin and edge. Add the URL comparison and redirect checks to release validation, while keeping browser-level consumption checks for important scenarios. Monitor failed and unexpected asset requests after rollout, and be ready to disable or correct a hint independently if a stale configuration reaches production.

Keep hints focused on resources with a demonstrated need early in the relevant page load. The final page must remain correct when a client ignores the informational response.

Conclusion

A reliable Early Hints check compares the actual 103 targets with a hints-disabled baseline, then confirms redirects, consumption, and reuse in a browser. Verify current support and behavior in official documentation and on your own delivery path before treating the result as release-ready.

What would your domain sell for?

A free TidyURLs account unlocks the Domain Estimator. It prices a name from 191,011 real domain sales.