HTTP headers | Server-Timing

The HTTP Server-Timing header is a response-type header. This header is used to communicate between two or more metrics and descriptions for a given request-response cycle from the user agent. The HTTP Server-Timing header is useful to any back-end server timing metrics like read or write in any databases, accessing files, etc. It can be used in the developer tools to keep track of the server on the PerformanceServerTiming interface. The HTTP Server-Timing helps to perform in different ways to communicate with the metrics, those are listed below:

  • metrics name
  • metric with value
  • metric with description
  • metric with value and description

Syntax:

Server-Timing: metricsname| metricsvalue | metrcisdescription

Directives: There are no directives only need to mention the metrics name with all the details.



Example:

  • This example shows the single metrics.
    Server-Timing: cdn-cache
  • This example shows the single metrics with the value.
    Server-Timing: edge; dur=33
  • This example shows the single metrics with description.
    Server-Timing: cdn-cache; desc=HIT
  • This example shows the double metrics with description and value.
    Server-Timing: cdn-cache; desc=HIT, edge; dur=1

To check this Server-Timing in action go to Inspect Element -> Network check the response header for Server-Timing like below, Server-Timing is highlighted.

Supported Browsers: The browsers compatible with HTTP headers Server-Timing are listed below:

  • Google Chrome
  • Firefox
  • Safari
  • Opera


My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.