Re: [ServiceWorker] Can we change the body attribute of Request/Response to a method? (#606)

Maybe I am confused about what cost we are avoiding.

Presumably any non-HEAD HTTP request body will be used by the service worker in some way. Whether that be to read chunks with `req.body.read()`, to read the whole thing with a method like `req.text()`, or to put it in a cache, or to forward it onward, or something else. So, the UA implementation will be fetching the body from the network and storing chunks of it into memory in all these cases, right?

In these cases, what is the optimization in the OP? Is the issue perhaps the cost of reifying the body chunks (which the UA already has, right?) into JavaScript?


---
Reply to this email directly or view it on GitHub:
https://github.com/slightlyoff/ServiceWorker/issues/606#issuecomment-70793355

Received on Wednesday, 21 January 2015 07:03:54 UTC