Skip to main content

Server-Timing Content Acquisition

Probe configuration​

The following conditions must be met for the probe to successfully obtain a Server-Timing return:

  • x_server_switch The switch is ON ( true : ON, false : OFF).
  • server_timing The switch is ON ( true : ON, false : OFF).
  • In the same domain, the Ajax request domain name needs to be configured in cors_domains if the domain is crossed.
  • Server-Timing returned a non-null header value.

Example:

window.TINGYUN && window.TINGYUN.init && window.TINGYUN.init(function(ty_rum){ty_rum.server={
...
"x_server_switch":true,"server_timing":true,"cors_domains":["mall.tingyun.com","127.0.0.1:8089"]
...
}});

Server configuration required to turn on the Server-Timing switch​

In order to prevent the probe from reading the cross-domain return and reporting an error, if the Server-Timing switch is turned on, the server-side return needs to be configured to allow the browser to allow the JS probe to obtain the return .

Return value required for opening server_timing and x_server_switch cross-domain request:

# Fill in the origin according to the actual situation
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: X-Tingyun
Access-Control-Expose-Headers: Server-Timing