Is there a clear way to see exactly what is contributing to the build size of my project?
I am removing unused assets and optimizing my scene and my build size is increasing?!? Seems like scripts are contributing more to build size than textures, how is that even possible?
My project: https://playcanv.as/p/UO8N0xeC/
Build size != download size.
Use the Chrome dev tools network tab (cache disabled) to see how much the user would download.
All files in the assets folder, the compressed textures etc will be included in the build but it doesn’t mean that it will be downloaded by the user if the app doesn’t use them.
Is the project public? Can you link to the project itself please?
The app total download by user is 1.2MB from the build you linked
@yaustar Thanks for your reply.
I see when using the playcanvas link my project loads at 1.2mb (compressed file size) but if I download the project and upload it to my website I have to unzip it and it becomes 4.6mb.
Is there any way for me to self-host it at the compressed file size?
Check if you have GZIP compression enabled in your server:
If you don’t, enable it and you will get the same file sizes as when running your app from the playcanvas url.
Ok so it seems like GZIP is enabled on my site, so then I can just upload the zip file? How do I embed that then/access the index.html?
If you have access to a control panel then usually what you will do is:
- upload the zip exported from PlayCanvas
- extract its contents to a folder/subfolder of your server
- access the path using your domain name / path to server
If you are uploading through FTP, extract the zip locally to your machine and upload all files to your desired folder.
I am already doing this, extracting the zip locally and upload contents to a folder on my server via FTP, yet when I embed it does not use the compressed file size.
But you say I should upload the zip as well?
No I think you are doing everything fine.
There isn’t any notion of compressed files on the web. The files are uploaded as they are (js, png, jpeg etc.).
Your server is responsible of compressing the files when a user requests your app by visiting your url. If files are still served uncompressed most likely your server isn’t configured properly. You should contact your hosting company/admin about this.
Ok thank you for your help, will make sure my site is using gzip compression when requesting the app.