Thanks for the help Calinou, I'll have to look into Brotli compression as I want to keep this all on my own server as much as possible.
If that can get the same results as something like PAKO then that seems like the better option anyway.
EDITED:
EDITED x2: So I'm stupid, you can do this by just changing .htaccess, no need to mess w/ the javascript. Updated below.
EDITIED x3: Please see THIS POST before using htaccess!
Alright, so I'm using brotli compression and it seems to be working. Thank you again, Calinou. For my current game it gets the WASM from ~14mb down to ~3mb and the PCK from ~11mb down to ~2mb (which is also about 1-2mb better on each than .gz).
To anyone who is as clueless as I was, what I did was modify my .htaccess file to tell the browser that our .pck.br and .wasm.br files are compressed w/ brotli and to uncompress them and remove the trailing .br, thus making it work w/o modifying the game's javascript. My added .htaccess code looks like this:
(note: I'm new to this so if I have some stupid error in here, please let me know!)
FileETag None
<Files *.pck.br>
AddType "application/octet-stream" .br
AddEncoding br .br
</Files>
<Files *.wasm.br>
AddType "application/wasm" .br
AddEncoding br .br
</Files>
RewriteCond %{HTTP:Accept-Encoding} br
RewriteCond %{REQUEST_FILENAME}.br -f
RewriteRule ^(.*).br$ $1 [L]