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.

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
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
Do i need to have brotli module enabled in apache2 for these commands to work?
Sadly, it didn’t work.
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.