MaxD
May 24, 2021, 10:52am
#1
While trying to deploy the existing downloaded project and set it up to a local hosting, getting this warning:
responseType: arraybuffer being served with Content-Type: application/glb
Trying to setup the correct MIME-TYPE and DEFLATE (gzip) settings using the .htaccess with these settings:
AddType application/wasm .wasm
AddType application/glb .glb
SetOutputFilter DEFLATE
ADD glb to deflate
AddOutputFilterByType DEFLATE application/glb
Compress HTML, CSS, JavaScript, Text, XML and fonts
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE application/x-font
AddOutputFilterByType DEFLATE application/x-font-opentype
AddOutputFilterByType DEFLATE application/x-font-otf
AddOutputFilterByType DEFLATE application/x-font-truetype
AddOutputFilterByType DEFLATE application/x-font-ttf
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE font/opentype
AddOutputFilterByType DEFLATE font/otf
AddOutputFilterByType DEFLATE font/ttf
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE image/x-icon
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/xml
I’m not too familiar with server setups but PlayCanvas servers serves GLBs as model/gltf-binary
1 Like
MaxD
May 24, 2021, 3:44pm
#3
Thanks yaustar, model/gltf-binary helped to solve warnings. Still trying to make mod_deflate to work, but that’s hosting issues )
1 Like
MaxD
June 7, 2021, 8:44am
#4
Still trying to serve model/gltf-binary as gzipped with DEFLATE options ON.
We got the following response from the server support team:
Our senior team have taken a look at this on several occasions, and I’m afraid there isn’t much left to say - from our research, it looks like mod_deflate won’t target model/gltf-binary because it is binary data. In order to deliver compressed files in that format, you should use a command before deployment, as explained here:
https://github.com/CesiumGS/gltf-pipeline/blob/73a8dbc9e8987077396eb314c92bc22d83c692d4/README.md
The above would also be much quicker than on-demand gzip, so it’d be more beneficial to use this.
Does this makes sense to try ?
MaxD
June 7, 2021, 8:54am
#5
This is preview URL on the hosting platform: http://gallery.familyforeverychild.org/PreviewOnly/ as you can see the response for *.glb files is empty with net::ERR_CONTENT_DECODING_FAILED
Here is the working example: https://playcanv.as/p/Dw7QSLcJ/
I can’t see the warnings/errors on console. All the GLBs are loading correctly for me:
Not sure which command they are referring to tbh. At the moment, the PlayCanvas export doesn’t support Draco compression yet and that does require a separate WASM library so I wouldn’t go down that route yet unless you really need it if that’s what they are referring to.
MaxD
June 7, 2021, 9:36am
#8
Thanks for your quick reply.
That is because we deleted the weird settings inside the .htaccess made by the hosting support:
<IfModule mod_headers.c>
<FilesMatch "(\.glb)$">
Serve correct encoding type.
Header append Content-Encoding gzip
Header append Vary Accept-Encoding
</FilesMatch>
</IfModule>
We just reproduced everything on our local Apache server and managed to serve model/gltf-binary with gzip.
All we have to do is uncomment/load these two modules inside httpd.conf:
LoadModule deflate_module modules/mod_deflate.so
LoadModule filter_module modules/mod_filter.so
And add the .htaccess to the project with following options:
<IfModule mod_mime.c>
AddType application/wasm .wasm
AddType model/gltf-binary .glb
</IfModule>
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript model/gltf-binary
Everything works on our local server as expected.
Thanks for sharing! (we REALLY ought to have a page for Apache, AWS hosting in documentation )
Just to confirm that you are all good to go now?
MaxD
June 7, 2021, 9:53am
#10
Nope.
We are in touch with hosting support, trying to enable gzip for *.glb files without any success at the moment.
I’ll will let you know if we will break through this and how.
1 Like
MaxD
June 8, 2021, 1:55pm
#11
Finally we managed to solve the issue with gzip on the shared hosting (20i). It was a nightmare for two weeks till they finally made something there and it starts working as expected.
http://gallery.familyforeverychild.org/
.htaccess file now looks like this:
AddType application/wasm .wasm
AddType model/gltf-binary .glb
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript model/gltf-binary
1 Like
Good to hear that you managed to get to the bottom of this and thanks for sharing!