If you need to use a CDN to speed up your website, I have a simple solution for discuz forums that can make it easy for discuz webmasters to use CDN
1. First, create a CDN channel with your second-level domain name on Alibaba Cloud and wait for it to take effect
2. Bind this second-level domain name to your discuz root directory
3. Go to the background, global > upload settings> basic settings> local attachment URL address, change this item to something like this,http://img.aaa.cn/data/attachment, where img.aaa.cn is the second-level domain name you additionally bind, do not add /
4. Modify the config/config_global.php and set $_config['output']['staticurl'] = 'static/'; changed to $_config['output']['staticurl'] = 'http://img.aaa.cn/static/'; In addition, because there are bug img.aaa.cn s in several details of DZ, if you change this 4th point, it will cause errors in several details of DZ, so please judge for yourself whether to change this point
After completing the above actions, most of your dz's static resources can be accelerated by CDN, which is very simple to operate, but if your attachment has permission settings, then the user will not go to the second-level domain name you set in the background when downloading, so the CDN cannot be accelerated, this is completely unavoidable, even if you accelerate the whole site, you can't speed up this, not only discuz, phpwind also has this problem. Other common open source systems should be explored by yourself, but remember not to use Alibaba Cloud CDN to accelerate dynamic requests, including pseudo-static URLs
|