Download in build triple the size of download in editor

Hey people! We just deployed our play canvas project to our own server by uploading the built .zip.

Comparing the build with the editor download shows that much more file weight is downloaded in the build than in the editor. I checked if compression is enabled on our server which it is according to

Download in editor:

Download in build:

We have set many assets in the project to not preload and instead instantiate them once after the initial loading screen is finished (destroying them after 100ms so loading gets triggered) so the user can already start using the app while the rest of the assets finish loading. In the editor this works just fine but in the build models seem to get downloaded multiple times. You can see the build here.

Hope someone can help!

  • Paul

Edit: It turns out that while GZIP was enabled for the root folder, it was not enabled for each individual .glb file which may have caused the inflated file sizes. We’re investigating this!

1 Like

Update: Missing gzip encoding on the child folders was indeed the cause!

This is the setting which worked for our apache server.

1 Like

Nice find and thanks for posting the fix!

1 Like

Just wanted to add this to your answer.
Here is our apache configuration with a few more types:

<IfModule mod_mime.c>
	AddType application/json .json
	AddType application/wasm .wasm
	AddType image/dds .dds
	AddType model/gltf-binary .glb

<IfModule mod_deflate.c>
	AddOutputFilterByType DEFLATE application/javascript
	AddOutputFilterByType DEFLATE application/json
	AddOutputFilterByType DEFLATE application/wasm
	AddOutputFilterByType DEFLATE image/dds
	AddOutputFilterByType DEFLATE model/gltf-binary