As we know,loadFromUrl() needs a parameter which is a remote url,now my code works well:
// remoteUrl = 'https:..'; // this file was downloaded from editor
app.assets.loadFromUrl(remoteUrl, "model", function (err, asset) {...}
this file from remoteUrl is large,so I want to compress this file to reduce the network request time. so ,there are 4 steps:
1:compress this file
2:puts it on my server
3:download it
4:use this file
my problem is fourth step,after I download this file ,it is a compressed file ,I decompress it,the question is I got this decompressed file,how to load it into my scene
Thank you for your reply.
I didn’t make it clear,for example,I downloaded a model file from editor ,then I got a folder(it containes .json file and other textures) ,I just compressed this folder to put it on my company server.when I dowloaded this .zip file,I decompress it,it is a local file now,then I don’t know what is the url which is a parameter for the loadFromUrl() function,I get confused
Thank you. I’m a newer. I think this may be related to the file system.
In order to reduce the time of network requests, I think of compressing the resources on the server, which are still in the verification stage. Do you have any good suggestions
Have you enabled GZIP compression on the server (which is what PlayCanvas does it’s hosting servers)?
This compresses the files so when they are transferred to the client, they are compressed (eg the engine file which goes from 1.2MB to 120KB) and the client uncompressed in the browser.