Last updated: 2023-08-04
Don’t just collect it, remember to like it, old man@_@
1. WeChat cloud development configuration CDN
1.1 Packaging
1.2 File upload
1.3 Configuration path
Click on the file and we can see the path.
Configure this location and save it. The debugging passes.
2. Obtain a CDN server [Qiniu Cloud as an example]
We need to buy CDN products. The prices of different manufacturers are different. You can buy according to your own needs. There are basically discounts for new users. It is generally sufficient for testing or when the number of users is small.
[Note]
A very troublesome point here is that if you do not use WeChat cloud service, if you use other CDN services, you must use https .
2.1 Package WeChat mini-games
Small game unity packaging tool [Official]
Unity CDN configuration official document
2.2. Upload files to CDN server
As shown in the picture, when we package it through the WeChat tool, there will be two folders, minigame and webgl. We need to upload the files in the red box to our CDN.
If the path of the CDN we configure is http://www.mydomain.com/version02/
, then the resources on the CDN must be stored in the following way, and the system will directly obtain the corresponding files.
2.3. Resource optimization
The txt files here can also be compressed once. 8MB txt can be compressed to 2MB.
Compression tool GZIP compression tool . If the link fails, go to Baidu to find the gzip compression tool.
The suffix of the compressed txt is .gz. It can still be loaded using cdn.