Problem with wasm.br files


So i managed to serve the compressed builds with the proper .htaccess files. But i get these errors in the console. And also this appears when the build runs.
6929998--813409--upload_2021-3-13_2-42-21.png

Is the Content-Type of the response header of * .wasm.br set to application/wasm?

1 Like

That’s the problem! How can i add the content-type to apache2? I have added the .htaccess file that we can see in the webgl documentatio of unity. Thanks.

add line to .htaccess
AddType application/wasm .br

1 Like


Is it all correct?

sorry, Clear all relevant AddType / AddEncoding / AddOutputFilterByType in .htaccess and try the following settings

AddEncoding br .br
AddType application/wasm .wasm
AddType application/octet-stream .data
AddType application/javascript .js
AddOutputFilterByType BROTLI_COMPRESS application/wasm
AddOutputFilterByType BROTLI_COMPRESS application/octet-stream
AddOutputFilterByType BROTLI_COMPRESS application/javascript

1 Like

6930250--813460--upload_2021-3-13_5-28-57.png

Do i need to have brotli module enabled in apache2 for these commands to work?

Sadly, it didn’t work. :frowning:

yes, you need mod_brotli module install.

So i did the process described. Do this just allow me to serve the brotli files or does it compress the compressed files again?

Even after trying this process with the .htaccess file that you provided, still the same error.

Also keep in mind that I got the 2021 beta version.

Try to make the content of .htaccess only the following two lines

AddEncoding br .br
AddType application/wasm .wasm

So i tried that and i get this error now. I know i am from http because i can see the changes faster from my server.

delete this lines?

AddType application/octet-stream .data
AddType application/javascript .js
AddOutputFilterByType BROTLI_COMPRESS application/wasm
AddOutputFilterByType BROTLI_COMPRESS application/octet-stream
AddOutputFilterByType BROTLI_COMPRESS application/javascript

So i see that i get the same error trying to serve brotli2021 and also gzip2020 files. In gzip2021 with the same .htaccess as gzip2020, it works perfectly.
6930982--813649--upload_2021-3-13_15-30-26.png

6931000--813655--upload_2021-3-13_15-35-52.png