Understanding the X-Timer header
Last updated 2018-08-01
If you look at the raw headers returned with a response from a Fastly cached asset, you will notice some extra headers tacked on. One in particular is X-Timer. This header provides timing information about the journey of a request from end to end.
Here are two examples of X-Timer headers:
S1392947468.641059399,VS0,VE0(a cache HIT)
S1392951663.217806578,VS0,VE31(a cache MISS)
Let's break these headers down into their parts, separated by commas, and examine what each part means.
The first section of the header, starting with
S, represents a Unix timestamp of the start of the request on our edges.
The next section,
VS or "varnish start," represents the start of the varnish part of the request's journey. This should always be 0 (we've got to start counting somewhere).
And the last section,
VE or "varnish end," represents the sum of the length of the trip. For cache HITs, the length of the trip will nearly always be 0 (not actually zero, but less than a millisecond is rounded down). For cache MISSs, the number represents the number of milliseconds it took to retrieve the data from your origin server and send the response back to the requester. In the example above, it took 31ms to retrieve the data.