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

Can't make Brotli work with Apache

Discussion in 'WebGL' started by Quote_, Feb 18, 2020.

  1. Quote_

    Quote_

    Joined:
    Dec 14, 2015
    Posts:
    1
    Hey there,
    i was trying to set up a webgl build compressed with brotli to check if the game could load faster, but it don't load at all.

    I've set the .htaccess like that
    Code (csharp):
    1. <IfModule mod_mime.c>
    2.   AddEncoding br .unityweb
    3. </IfModule>
    but it gives me the error:

    upload_2020-2-18_17-1-38.png

    I've checked and the server has the Brotli_module enabled but it just doesn't work when i set the .htaccess like that, it was running with gzip before.

    Thanks in advance!
     
  2. lightmapper

    lightmapper

    Joined:
    Jan 14, 2015
    Posts:
    27
    I'm not 100% percent sure about this, but from my reading brotli needs to be served over https.
     
  3. hsallander

    hsallander

    Joined:
    Dec 19, 2013
    Posts:
    43
    Yes https I think is required. I was also struggling with the same error (ERR_CONTENT_DECODING_FAILED), and eventually the solution for me was to set Name Files As Hashes to true, as it seems in my case the problem was that I had cached versions of the wasm files in the indexedDb which weren't cleared when I did a hard reload or cleared the browser cache.