Skip to main content

Example of CDN and WordPress site integration via W3 Total Cache plugin

Last update:
  1. Create a CDN resource.
  2. Create a personalized domain for the CDN resource.
  3. Add a personalized domain to the CDN resource.
  4. Configure the W3 Total Cache plugin.
  5. Check the CDN resource.

1. Create a CDN resource

  1. In the Control Panel, on the top menu, click Products and select CDN.
  2. Click Create CDN resource.
  3. Enter the name of the resource.The name does not affect the resource settings and is used only for operation in the control panel.
  4. In the Content Source block, select Your Source.
  5. In the Domain or IP Address field, enter the domain of your WordPress site from where the CDN will take the static files.
  6. Click Create CDN resource.The CDN provider will create a default domain from which the content will be distributed.You can view the default domain in the control panel: in the top menu, click ProductsCDNCDN ResourcesCDN Resources → Resource page → General tab.

2. Create a personal domain for the CDN resource

  1. Open your DNS hosting control panel.

  2. Create a third-level domain, such as cdn.example.com. This domain will be used as your personal CDN domain for content distribution.

  3. Create a CNAME record.To do so, 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 a domain without a protocol.You can view the default domain in the control panel: in the top menu, click ProductsCDNCDN Resources → CDN Resources → Resource page → General tab.

3. Add a personal domain to a CDN resource

  1. In the Control Panel, on the top menu, click Products and select CDN.
  2. Open the CDN resource page → General tab.
  3. In the Personal Domains block, click Add Domain.
  4. Specify the third-level domain you created as your personal domain.
  5. Click Connect.

4. Customize the W3 Total Cache plugin

  1. Go to the WordPress admin console.
  2. In the left menu, go to the Plagins section.
  3. In the search box, type W3 Total Cache.
  4. In the search results in the W3 Total Cache plugin card, click Install NowActivate.
  5. In the left menu, go to PerformanceGeneral Settings.
  6. In the CDN block, check the Enable checkbox.
  7. In the CDN block, in the CDN Type field, select Generic Mirror.
  8. In the CDN block, click Save all settings.
  9. In the left menu, go to PerfomanceCDN.
  10. In the Configuration block, in the SSL support field, select Auto (determine connection type automatically).
  11. In the Replace site's hostname with field in the Configuration block, enter the domain that 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 ProductsCDN → CDN Resources → CDN Resources section → Resource page → General tab → Personal Domains block.
  12. Click Save all settings.

5. Check CDN resource

  1. Wait for the CDN resource to work.Usually it takes at least 30 minutes after all settings have been made.
  2. Open the file on your WordPress site using a link like example.com/images/image.png.If the file doesn't open, check your site's performance.
  3. Open the file through the default domain using a link of the form *.selcdn.net/images/image.png.If the file does not open, check the CDN and Host header settings.
  4. Open the file through the personal domain using a link like cdn.example.com/images/image.png.If the file does not open, verify that the CNAME record you added when you created the personal domain is correct.