Skip to main content

CDN: Quick start

Last update:

You can manage CDN in the control panel.

  1. Create a CDN resource.

  2. Optional: add a personal domain to the CDN resource.

  3. If your website runs on WordPress, integrate CDN and WordPress.

  4. Check CDN resource performance.

1. Create a CDN resource

A CDN resource is a set of settings that determine how content is fetched from the origin to CDN servers and delivered from CDN servers to end users.

The content origin is the location from which the CDN will request files. You can specify:

  • your own origin;
  • or an S3 bucket.
  1. In the control panel, on the top menu, click Products and select CDN.

  2. Click Create CDN resource.

  3. Select the type of files to distribute:

    • Static — suitable for distributing images, small video files, JavaScript files, CSS files, and more. Images and video files are compressed optimally. Text files are compressed by default using Gzip;
    • or Large files — suitable for distributing large files without quality loss, such as videos. Files from the content origin are not compressed; they are downloaded in parts (16 MB) using HTTP Range requests.
  4. In the Address field, specify your website domain or IP address.

  5. Click Create. When you create a CDN resource, a default domain is automatically generated. Files distributed by the CDN server will be accessible via a link in the format *.selcdn.net. You can keep the default domain or add a personal domain.

2. Optional: add a personal domain to the CDN resource

We recommend distributing content via a personal domain. Using third-party domains may hinder website promotion and affect search engine rankings.

  1. Register a domain.
  2. Create a CNAME record in DNS hosting.
  3. Add a personal domain in the control panel.
  4. Add an SSL certificate to the CDN resource.
  5. Replace the domain in links on the website.

1. Register a domain

If you do not yet have a domain you want to use as a personal one, register it. You can register a domain in Selectel.

If you already have a domain, go to step 2.

2. Create a CNAME record in DNS hosting

You can only use a subdomain of your main domain as a personal domain, for example cdn.example.com for example.com. You cannot use the main domain as a personal domain.

  1. Open the resource record editor for the domain:

    • if you delegated the domain in Selectel, go to the Selectel Control Panel: in the top menu, click ProductsDNS hostingDomain zones section;
    • if the domain is managed in another DNS hosting service, open the control panel for that DNS hosting service.
  2. Create a resource record. Specify:

    • record type — CNAME;

    • record name — a subdomain such as cdn.example.com;

    • value — a default domain such as *.selcdn.net. Specify the domain without the protocol, for example cdn.example.com. Each domain label can be up to 63 characters long. The total length of all labels must not exceed 253 characters.

      You can view the default domain in the control panel: in the top menu, click ProductsCDNCDN resources section → the domain will be specified in the resource line.

3. Add a personal domain in the control panel

  1. In the control panel, on the top menu, click Products and select CDN.

  2. In the CDN Resources section, open the resource page → General tab.

  3. In the Custom Domain block, click Add Custom Domain.

  4. Specify the custom domain for which you configured the record in step 2. If you have a Cyrillic domain, first convert it to Punycode. For example, for сдн.пример.рф you need to specify xn--d1ask.xn--e1afmkfd.xn--p1ai. You can use any Punycode converter — for example, at sweb.ru.

  5. Click Apply. While settings are being applied, the resource will have the PROCESSING status. You cannot apply other settings at this time. The settings will be applied once the resource enters the ACTIVE.

4. Add an SSL certificate to the CDN resource

  1. In the control panel, click Products in the top menu and select CDN.

  2. Go to the CDN Resource Certificates section.

  3. If you want to issue a Let's Encrypt certificate:

    3.1. In the menu, select Issue Let's Encrypt certificate.

    3.2. Select the CDN resource for which you want to issue a certificate.

    3.3. Click Issue.

  4. If you want to upload a custom certificate:

    4.1. In the menu, select Upload custom certificate.

    4.2. Specify a certificate name. It will only be used in the control panel.

    4.3. Add the domain certificate. It must start with -----BEGIN CERTIFICATE----- and end with -----END CERTIFICATE-----.

    You can add a certificate chain (main domain certificate, intermediate, and root) — make sure they form a complete chain. The Issuer value of the main certificate must match the Subject value of the first intermediate certificate, the Issuer value of the first intermediate certificate — with the Subject value of the second intermediate, and so on.

    4.4. Add the private key. It must start with -----BEGIN PRIVATE KEY----- and end with -----END PRIVATE KEY-----.

    4.5. Click Upload.

  5. Go to the CDN Resources section.

  6. Open the CDN resource page → Certificates tab.

  7. Select the HTTPS delivery via CNAME checkbox.

  8. In the Certificate field, select the certificate you issued in step 3 or uploaded in step 4.

  9. Click Apply. While settings are being applied, the resource will be in PROCESSING status. You cannot apply other settings during this time. The settings will be applied once the resource switches to ACTIVE.

If your website runs on WordPress, proceed to integrating CDN and WordPress.

If you chose your own content origin when creating the resource in step 1, replace the domain in the website's static file URLs with the personal domain cdn.example.com that you specified in step 3 when creating the CNAME record in step 2.

3. Integrate CDN and WordPress

If your website does not run on WordPress, proceed to checking CDN resource performance.

  1. Go to the WordPress administrator console.

  2. In the left menu, go to Plugins.

  3. In the search bar, enter the plugin name: W3 Total Cache.

  4. In the search results for the W3 Total Cache plugin, click Install NowActivate.

  5. In the left menu, go to PerformanceGeneral Settings.

  6. In the CDN block, select 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 PerformanceCDN.

  10. In the Configuration block, 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 CDN resource domain:

    You can find the default domain and personal domain in the control panel: on the top menu, click ProductsCDNCDN resources section → resource row.

  12. Click Save all settings.

4. Check CDN resource performance

  1. Wait until the CDN resource is active — it will change to the ACTIVE status.

  2. Open the file that the CDN should serve via the link on your website. Example link: example.com/images/image.png. If the file does not open, check your website's performance.

  3. Open the file via the default domain using the link. Example link: *.selcdn.net/images/image.png. If the file does not open, check the CDN resource settings and the Host header.

  4. If you added a personal domain in step 2, open the file via the personal domain using the link. Example link: cdn.example.com/images/image.png. If the file does not open, check the correctness of the CNAME record you created in step 2.