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. 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. 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.
^ can you give an example of how that would work?