Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

"configure your web server to host .unityweb files using gzip compression"

Discussion in 'WebGL' started by roseportalgames, Jan 19, 2019.

  1. roseportalgames

    roseportalgames

    Joined:
    Aug 9, 2017
    Posts:
    173
    Hi guys,

    I'm trying out my game as WebGL but the loading takes forever and the game is only 35MB. I actually thought it crashed but after 10 minutes it finally did start.

    The Google Chrome developer log showed me this:

    I have bold'ed the two interesting parts.

    I am already publishing to gzip (see attached screenshot), so what does the comment mean about hosting .unityweb files using gzip compression? What is it referring to?

    Also, what can I do about the WebAssembly.Module error? Is it the reason why everything loads so slow?

    Thanks. :)
     

    Attached Files:

    mvperrotta likes this.
  2. zeroisthenew1

    zeroisthenew1

    Joined:
    Jun 20, 2018
    Posts:
    8
    +1 I have the same question.
     
    MNNoxMortem likes this.
  3. nsmith1024

    nsmith1024

    Joined:
    Mar 18, 2014
    Posts:
    869
    no answers...great!
     
  4. EduardoLauer

    EduardoLauer

    Joined:
    Jun 10, 2013
    Posts:
    8
    You have to configure the server where your game is hosted to serve the files with the header "Content-Encoding: gzip" or br for those that use brotli.
     
    Last edited: Jun 6, 2019
    atorres1986 and old_pilgrim like this.
  5. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    2,132
  6. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,592
    how do you configure it though? is it just placing files in the right folder, or something more? having same issues. edit: got it, yeh just had to edit the file and do a bit of trail and error it works, amazing! loving unity and webgl right now.
     
    Last edited: Dec 6, 2021
  7. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,592
    lol back to this the htaccess file doesnt seem to be working when i compressed with brotli, or maybe i missed something simple.
     
  8. jesterjoy3

    jesterjoy3

    Joined:
    Apr 5, 2021
    Posts:
    3
    The htaccess configuration for brotli is different than gzip and uncompressed. make sure you have the right configutarion