Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Configure Heroku to host files using gzip compression

I am trying to deploy a node.js app on heroku , which is serving unity webGL exported game to clients. After Unity3d 5+ release , WebGL exports by Unity uses gzip compression by default .

Well ,

heroku server [Node.js] dont serves gzip compressed files , which is causing my Game to throw error in console on load , main unity loading window wont update (just blank) till files dont get completely download & a slight delay while browser manually decompresses it.

enter image description hereThese are the file types Unity WebGL Export provides = || . datagz || . jsgz || . memgz ||

So what i need is , a way to configure heroku node.js server for serving the gzip compression .

like image 220
Akira Lynn Avatar asked Mar 09 '16 21:03

Akira Lynn


1 Answers

It doesn't look like you are having issues serving gzipped files. The messages in the console could be a separate issue altogether.

What is more likely is that your node app is not serving the right folder or files. If you can provide a list of files that is in your build folder (I assume that this is where Unity places its files), I can take a look.

Also, do review your Heroku configuration, namely the command used by the web process. If it is npm start or something, then look at the script it points to (see in your package.json file), and see if it is serving files out of the build folder.

like image 182
Jaryl Avatar answered Sep 23 '22 14:09

Jaryl