Search Unity

Uncaught unknown compression method (ver5.3.1f1, chrome, firefox)

Discussion in 'Web' started by belut, Jan 2, 2016.

  1. belut

    belut

    Joined:
    Jan 1, 2016
    Posts:
    2
    Hi there.

    About error of title.
    Chrome, the same problem occurred in both Firefox. I am troubled.

    In version 5.2.2f1, it was working.
    After update to 5.3.0f1, no longer work.
    It has not changed the situation to be updated to 5.3.1.
    error.jpg

    1. Apache will have to extract the gzip.
    (It is working, in version 5.2.2f1 project. Attached image top)

    2. I cleared the browser cache.
    (Refer to the other thread, I tried)

    Is there a solution?
    Please advise.
    thank you.
     
  2. jwmickey

    jwmickey

    Joined:
    Nov 5, 2015
    Posts:
    8
    I'm also having this problem. Pre 5.3, to configure nginx to serve pre-compressed files all you had to do was:
    1. Move compressed files to the Release folder
    2. Rename *gz to *.gz
    3. Set gzip_static on; in the location for the webgl files:
    location /my_webgl_build/Release {
    gzip_static on;
    }

    I was really hoping that a future release would put the compressed files in the same directory and name them *.data.gz, *.mem.gz, and *.js.gz so that nginx users could eliminate steps 1 and 2 above and have easier deployments, but that was a minor inconvenience.

    Now with this new setup, I no longer understand how to properly configure the web server to send pre-compressed files. I've tried the following pseudo-config:

    location /my_webgl_build {
    alias /path/to/webgl/build;

    location ~* \.(data|mem|js)gz$ {
    add_header Content-Encoding gzip;
    gzip off; # I've tried with and without this line
    }
    }

    With this setup I also get the "Uncaught unknown compression method" error for each of the three compressed files.

    In addition to this problem, it seems now that even when using the new automatic decompression (via javascript) that the loading bar does not update until just before the content is ready. Previously, the loading bar animation was smooth and consistent. Now, the loading bar displays, the loading takes place, and then the bar jumps to at or near 100% and then immediately the content is ready. My first hunch was that the decompression in javascript was eating up the UI thread, but I haven't been able to test that theory because I can't get a setup working where the pre-compressed files are served, removing the need for the javascript decompression step.
     
  3. belut

    belut

    Joined:
    Jan 1, 2016
    Posts:
    2
    I have the following thread to reference, I found a solution.
    http://forum.unity3d.com/threads/uncaught-exception-unknown-compression-method.373302/

    However, I think it is not a fundamental way.

    The index.html and modified as follows.

    * before
    Code (JavaScript):
    1.   var Module = {
    2.     TOTAL_MEMORY: 134217728,
    3.     errorhandler: null,            // arguments: err, url, line. This function must return 'true' if the error is handled, otherwise 'false'
    4.     compatibilitycheck: null,
    5.     dataUrl: "Release/WebGL.data",
    6.     codeUrl: "Release/WebGL.js",
    7.     memUrl: "Release/WebGL.mem",
    8.   };
    * after
    Code (JavaScript):
    1.   var Module = {
    2.     TOTAL_MEMORY: 134217728,
    3.     errorhandler: null,            // arguments: err, url, line. This function must return 'true' if the error is handled, otherwise 'false'
    4.     compatibilitycheck: null,
    5.     dataUrl: "Release/WebGL.datagz",
    6.     codeUrl: "Release/WebGL.jsgz",
    7.     memUrl: "Release/WebGL.memgz",
    8.   };
    I already fix .htaccess etc, in accordance with the existing information.
    But in my environment, it did not fix and not this way.
     
    Last edited: Feb 7, 2016
    Dragonic89 likes this.
  4. Dragonic89

    Dragonic89

    Joined:
    Jan 3, 2013
    Posts:
    48
    This is perfect. I had the same error since yesterday, but my game is working now with this fix ! Thank you !