Server-Timing header
Servers send timing metrics to the page through a response header.
In one line
Can pass timing numbers from the server to page scripts
Servers send timing metrics to the page through a response header.
Lets a backend or CDN expose database, cache and edge timings to client JavaScript, for monitoring or for leaking server state when cross-origin readable.
What it can and can't do
What the user does: Nothing. It happens as the page loads
It can
- Send database, cache and edge time numbers in a response header
- Let page code see those numbers
- Show server details when another site allows other sites to see them
It cannot
- Show you the numbers by itself
- See your files
- Ask permission first
- Show another site's timings without that site's approval
Browser support
| Browser | Status | First version | Released | Note |
|---|---|---|---|---|
| Chrome | Supported | 65 | 2018-03-06 | None |
| Edge | Supported | 79 | 2020-01-15 | None |
| Firefox | Supported | 61 | 2018-06-26 | None |
| Safari | Supported | 16.4 | 2023-03-27 | None |
| Safari on iPhone | Supported | 16.4 | 2023-03-27 | None |
| Chrome on Android | Supported | 65 | 2018-03-06 | None |
| Samsung Internet | Supported | 9.0 | 2018-09-15 | None |
How a site asks for it
| API | Server-Timing: db;dur=53, cache;desc="hit"; PerformanceResourceTiming.serverTiming |
| Browser compat keys | api.PerformanceServerTiminghttp.headers.Server-Timing |
| How access is granted | none |
| What the user sees | Not listed |
| Needs a secure context (HTTPS) | No |
| Needs a user gesture | No |
| How long it lasts | Not listed |
| How to take it back | Not listed |
| Inside an iframe | Not listed |
Typical flow
- Server adds Server-Timing header
- Browser parses into serverTiming entries
- Script reads name, duration, description
Data you get
What comes back: Each metric name plus dur in ms
Shape: list
| Field | Type | Unit | Range | Precision |
|---|---|---|---|---|
duration | float | ms | 0 to unbounded | as sent by server |
Technical limits
- Cross-origin requires Timing-Allow-Origin
- Not a fingerprint, reveals server side state
The story
What it is
A website's server sends timing numbers to the page, such as how long the database took.
For you
You never see it. When a page loads, the server may say it took 120 ms to look something up. That number goes into the browser tools and helps the team fix slow pages.
For makers
Teams use it to see exactly where a page spends time, in the server, cache or database, right from real visitors. It also lets edge networks report cache hits, so teams can tune them.
Where you see it
| Type | Example | Apps |
|---|---|---|
| shopping | A retailer sees that a product page waits 400 ms on its stock database, and speeds it up. | None named |
| developer | A developer reads timing in browser tools to see if a slow page is the server or the network. | None named |
| analytics | A monitoring service collects server timing from real visitors and charts slow steps. | Datadog RUM, New Relic |
| news | A news site learns that its CDN missed the cache for a viral story and fixes the rules. | Cloudflare, Fastly |
| games | A game site checks how long the matchmaking call takes before a player joins a lobby. | None named |
| banking | A bank tracks how long each login step takes on the server to find slow spots. | None named |
| security | A site sees that server time spikes during an attack and uses the numbers to respond. | None named |
Risks
- Can expose internals
- Seen by scripts on the page
What the platform says
- MDN: Server-Timing header. Explains how servers can pass timing about their work to the browser for tools and analytics.
Good uses and abuse
Legitimate uses
- Performance debugging and CDN diagnostics (Cloudflare, Fastly, Vercel)
Known abuse
- Server can tag visitors for correlation, cross-origin side channels with TAO
Scores
| Score | Value | Meaning |
|---|---|---|
| Sensitivity | 1 of 5 | How revealing the data is |
| Utility | 3 of 5 | How useful it is to honest apps |
| Friction | 0 of 5 | How much the user has to do |
| Fingerprint bits | 1 | Rough identifying entropy, when known |
History
- 2023-03, Safari 16.4: Server-Timing supported
Related capabilities
Related
- Navigation and Resource Timing. Can see how fast the page and each file loaded for you
Sources
How well checked: Based on official documentation.