resource-timing icon indicating copy to clipboard operation
resource-timing copied to clipboard

Adding HTTP method to ResourceTiming API structure

Open sohomdatta1 opened this issue 2 years ago • 8 comments

The ResourceTiming API structure doesn't currently give us insight into what HTTP method was used to fetch a specific resource and/or make a API call. It would be great if the HTTP method used to make a specific HTTP request could be added to the ResourceTiming structure.

The major usecase where I see this getting used (and from where this idea came from) is to debug cases where a POST request would have additional latency/overhead over a GET request or vice-versa.

sohomdatta1 avatar Mar 22 '23 13:03 sohomdatta1

^^ @nicjansma

yoavweiss avatar Mar 22 '23 13:03 yoavweiss

Let's add this to the agenda for the WG for discussion this week

clelland avatar Mar 27 '23 14:03 clelland

Yes this seems very useful for being able to segment the performance of URLs that are used with different methods. REST APIs come to mind here.

nicjansma avatar Mar 30 '23 17:03 nicjansma

For posterity, we had discussed this on the April 13th, 2023 W3C WebPerf Working Group call.

Notes @ https://docs.google.com/document/d/1fIgfd7ONz-sES55qRFHQI_eQUnynnyX2Asrs-cwAQ_Q/edit#heading=h.nuc3bt9j96hk

Summary:

  • Useful to know whether a HTTP request was a GET/POST/etc from ResourceTiming, as they may have different performance characteristics
  • Question if this would be covered by CORS, or would need another opt-in
  • Next steps: Getting a security review from security folks at each vendor

nicjansma avatar Apr 25 '23 13:04 nicjansma