Skip to main content
Example of CDN and WordPress site integration via W3 Total Cache plugin
Last update:

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

For your information

These are instructions for connecting a CDN to a WordPress site via the Selectel provider and the W3 Total Cache plugin.

  1. Create CDN-resource.
  2. Create a personal domain for the CDN resource.
  3. Add personal domain to CDN-resource.
  4. Configure the W3 Total Cache plugin.
  5. Check CDN-resource.

1. Create a CDN resource

  1. In Control Panel, go to CDNCDN Resources.
  2. Click Create CDN resource.
  3. Enter the name of the resource. The name has no effect on the resource settings and is only used in the control panel.
  4. Select a Selectel provider.
  5. Specify the content source — the domain of your WordPress site from where the CDN will take static files, e.g. example.com.
  6. Click Create CDN resource. The CDN provider will create a default domain from which to distribute content. You can view the default domain in control panel under CDNCDN resources → resource page → General tab.

2. Create a personal domain for 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 a personal CDN domain for content distribution.

  3. Create a CNAME record:

    • record type is CNAME;
    • record name is a subdomain of the form cdn.example.com;
    • value is the default domain in *.selcdn.net format. You can view the domain in control panel under CDNCDN resources → resource page → General tab. Specify the domain without the protocol.

3. Add a personal domain to the CDN resource

  1. In Control Panel, go to CDNCDN Resources.
  2. Open the CDN resource page → General tab.
  3. In the Personal Domains block, click Add Domain.
  4. Specify the third-level domain that you created as a personal domain.
  5. Press Connect.

4. Customize W3 Total Cache plugin

  1. Go to the WordPress admin console.
  2. In the left menu, go to Plagins.
  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 box, click Save all settings.
  9. In the left menu, go to PerfomanceCDN.
  10. In the Configuration box, in the SSL support field, select Auto (determine connection type automatically).
  11. In the Configuration block, in the Replace site's hostname with field, enter the domain that added to the CDN resource as a personal domain. The personal domain can be viewed in control panel: CDN sectionCDN resources → CDN resource page → General tabPersonal Domains block.
  12. Press Save all settings.

5. Check the CDN resource

  1. Make sure that at least 30 minutes have passed after all the settings — this time is necessary for the CDN resource to fully work.
  2. Open the file on your WordPress site using a link of the form example.com/images/image.png. If the file doesn't load, the problem is on the side of your site.
  3. Open the file through the default domain using a link of the form *.selcdn.net/images/image.png. If the file does not load, check the CDN and Host header settings.
  4. Open the file through your personal domain using a link of the form cdn.example.com/images/image.png. If the object does not load, check that the CNAME record you added when create-personal-domain is correct.