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. Ensure you have topped up your balance with 500 ₽.

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

  3. Click Create CDN resource.

  4. Select the content delivery optimization type. You can [change the optimization type](/cdn/content/content-delivery-optimization.mdx#change-optimization-type after creating the CDN resource.

    • Static — suitable for delivering small files: images, video and audio files, text formats;
    • or Large files — suitable for delivering large files without loss of quality, for example, video. Files are cached and delivered in parts (slices) using HTTP Range requests. By default, the slice size is 16 MB; you can change the slice size after creating the CDN resource.
  5. In the Address field, enter the domain or IP address of your website.

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

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

We recommend distributing content through a personal domain. Using a third-party domain can make website promotion difficult and affect your search engine ranking.

  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 the links on your website.

1. Register the domain

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

If you already have a domain, proceed to stage 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 have delegated the domain to Selectel, go to the Selectel Control Panel: in the top menu, click ProductsDNS Hosting → the Domain zones;
    • 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 in the format *.selcdn.net. Specify the domain without the protocol, for example cdn.example.com. Each domain level can be up to 63 characters long. The total length of all levels 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, when creating a resource in stage 1, you chose your own content source, replace the domain in the static file URLs on your website with the personal domain of the format cdn.example.com, which you specified in step 3 when creating a CNAME record in stage 2.

3. Integrate CDN and WordPress

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

  1. Go to the WordPress admin console.

  2. In the left menu, go to the Plugins section.

  3. In the search bar, enter the plugin name — 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 the PerformanceGeneral Settings section.

  6. In the CDN block, select the Enable check box.

  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 the PerformanceCDN section.

  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 view the default domain and personal domain in the control panel: on the top menu, click ProductsCDNCDN resources section → the resource row.

  12. Click Save all settings.

4. Check the CDN resource

  1. Wait for the CDN resource to become functional — it will switch to the ACTIVE status.

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

  3. Open the file via the default domain using the link. Link example: *.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 custom domain in step 2, open the file via the custom domain using the link. Link example: cdn.example.com/images/image.png. If the file does not open, check the correctness of the CNAME record you created in step 2.