I am using resource timing api to capture the encoded, decoded and transfer size of all the resources of a page,but for some of the resources it is giving the zero for all the 3 keys. Please help me to solve this.
Asked
Active
Viewed 165 times
2 Answers
0
it happens for the cross origin resources when the "Timing-Allow-Origin" header is not set by the server and hence wont expose the resource timing values please go through the specification here
hope this answers your question.

jayasimha reddy
- 71
- 1
- 4
0
The Timing-Allow-Origin
header is a response header. It can be zero due to the cross-origin restrictions.
You can check your browser header response section. Also, you want to share the timing data with a web site.
Timing-Allow-Origin: https://example.com
Or, you can specify a wild card, but it not recommended because it will open yourself up to cross-site timing attacks via the Web Resource Timing API.
Timing-Allow-Origin: *
Bonus: Twitter Silhouette Attack

Nevzat Günay
- 1,039
- 11
- 19