Re: [whatwg/fetch] Add flag to indicate delay-tolerant Request, to enable request coalescing. (#184)

I'd like to pick this thread back up in the context, at the very least, of analytics pings.

I see this solution being instrumental to minimize the loss of analytics pings, while also minimizing negative effects on performance. I did some limited testing on different devices and it showed that simple batching can improve battery utilization by 33-38%. The benefit would be even better if it was possible to align batching with radio "on" times.

The @igrigorik 's description above sounds great. But couple of nuances:

1. In Fetch API, this feature has to be coupled with [keep-alive](https://github.com/whatwg/fetch/pull/388) to avoid data loss.
2. It's possible to also extend `sendBeacon` API to explicitly allow batching, but it seems that overall direction is to make Fetch spec stronger, so this is probably optional.
3. This API has to be opt-in, e.g. via `RequestInit.allowBatchingDelay`-sort of parameter that would indicate maximum allowed batching delay in milliseconds.
4. Delayed requests should include additional age-style HTTP header, such as `Queue-Delay: milliseconds` or similar to allow receiving server service to reconstruct the correct timeline. This header has to be CORS-friendly.

/cc @annevk @tyoshino 


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/issues/184#issuecomment-301850972

Received on Tuesday, 16 May 2017 17:13:23 UTC