Cannot run webGl build: unknown compression method incorrect header check

Hello,
I’m trying to run a webGl app but I’m having some problem on my apache server (any browser).
I tryed by adding this rows on my htaccess but it doesn’t work

<IfModule mod_headers.c>
    Header set Access-Control-Allow-Origin "*"
</IfModule>
</FilesMatch>
<IfModule mod_headers.c>
    Header set Access-Control-Allow-Origin http://www.ekadesign.it 
    Header set Access-Control-Allow-Credentials true
</IfModule>

Can someone help me?
Thanks

Hello AnnaS.

Could you post here your complete .htaccess file content? Your server does not rewrite the uncompressed request url but instead is adding Content-Encoding: gzip header to the compressed response, which is the opposite of what the default .htaccess is expected to do.

sure, I did some test but this is the last version of the .htaccess. Thanks

Hello AnnaS, here are some notes:

  1. Are you sure this is the complete .htaccess file? You server appends Content-Encoding: gzip header which should only be provided if you rewrite the request url, otherwise this header should not be added. Check your parent folders and server configuration for the place where this header is appended, this is not a default behavior and therefore should have been explicitly specified. Alternatively you can add Header unset Content-Encoding to the Release/.htaccess

EDIT: the screenshot displays web/.htaccess, while you would normally change configuration only for a subfolder like /yourgame/Release/.htaccess. Note that normally all the .htaccess files starting from the root down to the served file contribute to the request. In this regard those #BEGIN/#END WordPress indicate that some additional configuration might be present.

  1. As you are not using rewrite url, the .jsgz should have Content-Type: application/octet-stream as well as other gz files, because in such setup it will be requested as a binary file (the build should work in any case, this is just a note)

  2. Adding CORS authorization to itself should not have any effect. WebGL resource paths are relative to the document url, therefore should normally be also accessible from subdomains without CORS.

  3. The resolution is too high, those are not physical pixels, so “1920px” might not work as you expect on displays with different DPI scaling and retina screens. Consider additional testing.

  4. If you what your content to run reliably in 32-bit Chrome, consider allocating a bit less than 1GB memory, like 900MB for example, normally 768MB should do.

With the changes described above I was able to successfully launch your build.