# Http streaming chunks in JavaScript

**URL:** <https://forum.dfinity.org/t/http-streaming-chunks-in-javascript/9746>\
**Category:** JavaScript\
**Created:** [December 17, 2021, 3:47am UTC](https://forum.dfinity.org/t/http-streaming-chunks-in-javascript/9746 "2021-12-17T03:47:23Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![cryptoschindler](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/cryptoschindler/32/26_2.png) [@cryptoschindler](https://forum.dfinity.org/u/cryptoschindler)\
**Post date:** [December 19, 2021, 2:06pm UTC](https://forum.dfinity.org/t/http-streaming-chunks-in-javascript/9746/5 "2021-12-19T14:06:03Z")

</div>

Can you maybe record a video on this? I’m having a hard time figuring out what the different ways of retrieving data from a canister look like. So far I have this understanding regarding retrieving data that doesn’t fit into a single message, please correct me if I’m wrong.

**Retrieving assets from an asset canister**  
To my understanding, when you request an asset on an asset canister via URL, this HTTP request reaches a boundary node first.

If accessed through `ic0.app`, a service worker will be installed in your browser. The service worker calls the HTTP interface of the canister directly issuing query calls to the `http_request` of the asset canister. The services worker then _should_ handle streaming for you, unfortunately it’s not [implemented yet](https://forum.dfinity.org/t/service-worker-bug-body-does-not-pass-verification/7673/5). The boundary node just forwards this call to a canister, no transformation of the request is taking place.

If accessed through `raw.ic0.app` the boundary node translates the [request into Candid which is then forwarded to the canister.](https://forum.dfinity.org/t/clearing-up-confusion-over-dynamically-storing-serving-large-assets/6764) If the asset is big enough to require streaming, the boundary node will take care of that for you. So you do not need to implement a streaming strategy in the Frontend, this happens automagically.

When using the agent-js, you’re basically in the same situation as with the service worker, no support for streaming out of the box yet.

> [@anon74414410](#):
>
> Agent-js can download chunks, but it’s the responsibility of the canister to determine when and how the chunks are returned.

^ can you give an example of how that would work?

---

_[View the full topic](https://forum.dfinity.org/t/http-streaming-chunks-in-javascript/9746)._
