You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When it comes to hosting PlayCanvas yourself, using GZIP to speed up the delivery of asset files is a must. Since pulling down project builds and gzipping tend to be done in the same workflow, it would be nice if this tool could also GZIP your assets for you.
Where GZIP'ing is needed
GZIP'ing is typically not needed if a CDN is in use because most CDNs will do the gzipping automatically for you. However, if you're not using a CDN, for example your own server without a CDN or files directly linked to AWS S3, it is critical to GZIP assets to significantly reduce asset delivery time.
How GZIP'ing can be done
There's a few ways that GZIP'ing is done. I've found the easiest method is to just GZIP all files in a project, so you don't have to come up with a way to tell the host (such as AWS S3) which assets are GZIP compressed and which are not. However, it should be noted that video files, like MP4, cannot be GZIP compressed under any condition because they are delivered to the client in chunks. In a PlayCanvas project I think it would be most logical to GZIP only the assets. So, I think this feature would need to give you the option of gzipping either the whole project, certain file types, or just assets.
Example of how I'm using GZIP
If it helps, this is how I use GZIP in my workflow:
Ask PlayCanvas for build of project.
Download project from PlayCanvas.
GZIP all PlayCanvas files in Bash. The command below just means GZIP files with the greatest compression levels and replace the original file with the gzipped version.
GZIP has to be done in conjunction with telling your server or host that these files are already GZIP'd. Failing to do this means your host will serve these GZIP files as if they are uncompressed and browsers will be unable to use the files since they don't know that they're compressed. That's why, while GZIP should be used whenever possible, if your CDN or server that GZIPs on-the-fly does it already, don't bother doing it ahead of time.
The text was updated successfully, but these errors were encountered:
Extra note:
I forgot to mention this, it's somewhat important. I said most CDNs will GZIP. An issue I did run into (ie the CDN Netlify uses), is that the 3D assets might not get GZIP'd even though the CDN supports GZIP'ing. CDNs will often look for specific file formats to GZIP and something like .dds may not get GZIP'd even though it absolutely needs to be. This is another reason for doing GZIP'ing manually.
Description
When it comes to hosting PlayCanvas yourself, using GZIP to speed up the delivery of asset files is a must. Since pulling down project builds and gzipping tend to be done in the same workflow, it would be nice if this tool could also GZIP your assets for you.
Where GZIP'ing is needed
GZIP'ing is typically not needed if a CDN is in use because most CDNs will do the gzipping automatically for you. However, if you're not using a CDN, for example your own server without a CDN or files directly linked to AWS S3, it is critical to GZIP assets to significantly reduce asset delivery time.
How GZIP'ing can be done
There's a few ways that GZIP'ing is done. I've found the easiest method is to just GZIP all files in a project, so you don't have to come up with a way to tell the host (such as AWS S3) which assets are GZIP compressed and which are not. However, it should be noted that video files, like MP4, cannot be GZIP compressed under any condition because they are delivered to the client in chunks. In a PlayCanvas project I think it would be most logical to GZIP only the assets. So, I think this feature would need to give you the option of gzipping either the whole project, certain file types, or just assets.
Example of how I'm using GZIP
If it helps, this is how I use GZIP in my workflow:
content-encoding
set.Important note about GZIP
GZIP has to be done in conjunction with telling your server or host that these files are already GZIP'd. Failing to do this means your host will serve these GZIP files as if they are uncompressed and browsers will be unable to use the files since they don't know that they're compressed. That's why, while GZIP should be used whenever possible, if your CDN or server that GZIPs on-the-fly does it already, don't bother doing it ahead of time.
The text was updated successfully, but these errors were encountered: