Example of CDN and WordPress site integration via W3 Total Cache plugin
- Create a CDN resource.
- Create a personalized domain for the CDN resource.
- Add a personalized domain to the CDN resource.
- Configure the W3 Total Cache plugin.
- Check the CDN resource.
1. Create a CDN resource
- In the Control Panel, on the top menu, click Products and select CDN.
- Click Create CDN resource.
- Enter a name for the resource. The name has no effect on the resource settings and is used only for operation in the control panel.
- In the Content Source block, select Your Source.
- In the Domain or IP Address field, enter the domain of your WordPress site from where the CDN will take the static files.
- Click Create CDN resource. The CDN provider will create a default domain from which content will be distributed. You can view the default domain in the Control Panel: from the top menu, click Products → CDN → CDN Resources → CDN Resources → Resource page → General tab.
2. Create a personal domain for the CDN resource
-
Open your DNS hosting control panel.
-
Create a third-level domain, such as
cdn.example.com.This domain will be used as your personal CDN domain for content distribution. -
Create a CNAME record. To do this, specify:
- record type is CNAME;
- record name is a subdomain of the form
cdn.example.com; - value - default domain of the form
*.selcdn.net. Specify the domain without the protocol. You can view the default domain in the control panel: in the top menu, click Products → CDN → CDN Resources → CDN Resources section → Resource page → General tab.
3. Add a personal domain to a CDN resource
- In the Control Panel, on the top menu, click Products and select CDN.
- Open the CDN resource page → General tab.
- In the Personal Domains block, click Add Domain.
- Specify the third-level domain you created as your personal domain.
- Click Connect.
4. Customize the W3 Total Cache plugin
- Go to the WordPress admin console.
- In the left menu, go to the Plagins section.
- In the search box, type
W3 Total Cache. - In the search results in the W3 Total Cache plugin card, click Install Now → Activate.
- In the left menu, go to Performance → General Settings.
- In the CDN block, check the Enable checkbox.
- In the CDN block, in the CDN Type field, select Generic Mirror.
- In the CDN block, click Save all settings.
- In the left menu, go to Perfomance → CDN.
- In the Configuration block, in the SSL support field, select Auto (determine connection type automatically).
- In the Replace site's hostname with field in the Configuration block, enter the domain you added to the CDN resource as a personal domain . You can view the personal domain in the Control Panel: in the top menu, click Products → CDN → CDN Resources → CDN Resources section → Resource page → General tab → Personal Domains block.
- Click Save all settings.
5. Check CDN resource
- Wait for the CDN resource to start working. Usually it takes at least 30 minutes after all settings have been made.
- Open the file on your WordPress site using a link like
example.com/images/image.png. If the file does not open, check your site's performance. - Open the file through the default domain using a link like
*.selcdn.net/images/image.png. If the file does not open, check the CDN and Host header settings. - Open the file through the personal domain using a link like
cdn.example.com/images/image.png. If the file does not open, check that the CNAME record you added when you created the personal domain is correct.