Brottli compression in asset canister

Hello, We have a pretty big game and we want to deploy it fully on chain but with brottli compression, asset canister is not able to serve brottli compressed files as it doesn`t set the necessary headers in the request so it will be correctly downloaded by webgl loader. Is there any possibility to enable serving brottli compression in the asset canister or we need to serve them via a backend canister?

Is it? According this line of the dfx asset canister the content-encoding header should be set if there is an encoding. Not sure however when and how brotli br is detected and set but, according this entry in the CHANGELOG you should be able to enforce headers.

But @Severin can probably better answer your question than me, who do not really know dfx, after the long weekend.

You can already serve brotli, but you’d need to orchestrate the upload yourself. Back when we decided to not add brotli it was because of the size of the service worker.

@NathanosDev now that we have the new boundary node setup without the service worker, do you think it’s worth revisiting this decision?

Brotli compression works now. I’ve tried and tested that successfully in a custom built asset canister. So I don’t see any reason to not support it in the pre built asset canister.

Sweet! I’ll file a ticket to add it by default then :slightly_smiling_face:

(Note to self: ticket)

2 Likes

PR is merged and it should appear in the dfx beta version that will go out this week