Last update at :2024-07-06,Edit by888u
In the process of choosing and using the WordPress program to build a website, many of our netizens will feel that as the content of the website becomes richer, the opening speed of the website becomes slower and slower. However, there are many personal websites with rich content but the opening speed is still quite fast. Yes, even the configurations are similar. In fact, it is not just a WordPress program problem. If possible, as the website content increases, especially pictures and attachment media resources, it will occupy larger bandwidth resources.
We can consider storing static resources separately, such as storing them in third-party storage such as Qiniu Cloud, Youpai Cloud, Tencent Cloud COS, Alibaba Cloud OSS, etc. In this article, Snail shares that uploading can be achieved based on the WordPress program After the static resources are uploaded, they can be stored separately in COS, or they can be backed up locally and in COS simultaneously, and then the resources in the COS object storage can be called on the website to improve the website opening speed.
First, apply for Tencent Cloud COS object storage
Here we recommend purchasing a storage package before using Tencent Cloud COS object storage, which saves costs compared to billing traffic separately. Of course, if we need to bind a domain name to use CDN in the future, we will also need to purchase a CDN traffic package. [Buy Tencent Cloud COS storage package here]
Resource packs are not available in all regions. In some regions, resource packs are not available for purchase.
Second, activate the COS bucket to extract parameters
Here we select the required region and then create a bucket. Pay attention to the read and write permissions. You can choose public read and private write, or public read and write, so that the pictures or resources you upload later can be displayed on the website. I don't care about the parameters here, I will get them later.
Here go to the [Basic Configuration] corresponding to the COS bucket and you can see several parameters marked by the snail in the picture above, which will be used later.
Third, obtain Tencent Cloud API
After the above parameters have been obtained, we still need to obtain the Tencent Cloud API key information, otherwise it will not be uploaded.
Some netizens cannot find where to see the Tencent Cloud password, as shown in the picture above [Key Management].
Then we go to the key management to create a new key, or obtain the existing password directly. Three parameters are required, namely APPID, SecretId, and SecretKey. It will be used later when configuring the WPCOS plug-in.
Fourth, WPCOS plug-in download and installation configuration
1. Plug-in download
WPCOS plug-in: https://github.com/laobuluo/wpcos/
It should not be difficult to download and install this plug-in into your current WP. In view of the compatibility of the plug-in, Snail recommends backing up the website first.
2. Plug-in activation configuration
Fill it in based on the parameters we already know. In particular, we need to pay attention to two things. For the local folder, we usually fill in \\"wp-content/uploads\\". The COS remote address is the [access domain name] on our bucket, and a tail needs to be added, such as \\" https://laozuo-1252202521.cos.ap-shanghai.myqcloud.com/wp-content/uploads\\", the tail needs to correspond to the above local folder.
It’s up to us whether to save it locally. If you want to save a copy locally, leave it unchecked. If you just want to transfer it to COS, check it. After the configuration is complete, let's try uploading a picture. If the picture can be stored in Tencent Cloud COS object storage and can also be seen on the website, it means there is no problem. If not, you need to adjust to see where the problem is.
Fifth, issues that need attention
If we are preparing to launch the WPCOS plug-in on an old website, after switching the plug-in, we need to manually upload all the image attachments in the local website to the corresponding bucket folder of Tencent Cloud COS, and need to replace the static files in the database in batches address.
This plug-in currently has a small BUG. If the default upload path is not restored after uninstalling the plug-in, you need to manually adjust it. We'll see if this problem is fixed later.
Recommended site searches: ICP registration number, domain name registration information query, which Hong Kong server is fast, Hong Kong high-defense server, Hong Kong server hosting, US host recommendation, IP check, German server, dynamic IP vps, cheap virtual host,
发表评论