ipfs / in-web-browsers

Tracking the endeavor towards getting web browsers to natively support IPFS and content-addressing
https://docs.ipfs.tech/how-to/address-ipfs-on-web/
MIT License
349 stars 29 forks source link

Server Timing API #167

Open lidel opened 4 years ago

lidel commented 4 years ago

The Server Timing API allows you to pass request-specific timing data from your server to the browser via response headers

Potential uses

In IPFS context, it could be a way for HTTP Gateway to indicate how long it took to

Improved debugging

As illustrated by @Gozala in https://github.com/ipfs-shipyard/ipfs-webui/pull/1534#issuecomment-652645285 I think bifrost team and other gateway providers could leverage it for debugging gateway performance when processing a specific request.

Improved UX in browser context

User agents (eg. IPFS-aware web browser) could utilize hints passed in Server Timing headers to improve user experience by providing higher resolution feedback about the state of request.

Example

> GET /ipfs/QmFoo HTTP/1.1
> Host: ipfs.io

< HTTP/1.1 200 OK
< Server-Timing: miss, ds;dur=53, dht;dur=47.2, bitswap;dur=120
< Server-Timing: cache;dur=23.2

References