Re: [ServiceWorker] FetchEvent.respondWith does something weird with the body of a response (#850)

If you want to clone a response, use the algorithms provided in Fetch.

If we take a step back and look at how this maps to JavaScript, I think `respondWith()` is pretty much required to "structured clone" and message that clone to the environment making the fetch. What exactly "structured clone" means here is not really defined and what it means for streaming is even less understood. (And of course, user agents might not have to "structured clone" and be able to share memory more efficiently if developers avoid poking the painful bits, but we don't have to define the fast paths in the specification, just encourage them.)

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/slightlyoff/ServiceWorker/issues/850#issuecomment-197725965

Received on Thursday, 17 March 2016 06:21:05 UTC