Use Case: How to Set Up the Static Content Distribution

Follow these steps to set up option:

  1. Move site static to a separate domain (such as static.example.com - this will be the content source). If you use Cloud Storage, creating a separate domain for the source is optional.
  2. Create a domain like cdn.example.com to work through the CDN.
  3. Create a CDN resource in the Control panel.
  4. Configure your DNS Registrar’s CNAME record with cdn.example.com to the domain of the CDN provider that the CDN provider allocates when connecting. For example, if you use CDN Selectel, such a domain looks like 85e77c09-bc03-43bf-b8f3-9492ae33390f.selcdn.net, where 85e72c09-bc03-43bf-b8f3-9492ae33390f is generated automatically.

    An example entry: cdn.example.com in 85e77c09-bc03-43bf-b8f3-9492ae33390f.selcdn.net

    Run the dig command in a terminal or use online services to check if the entry is correct. If you set the CNAME correctly, you will see an entry: cdn.example.com 14399 IN CNAME 85e77c09-bc03-43bf-b8f3-9492ae33390f.selcdn.net

  5. In your site settings, change the domain for the statics that you plan to serve through the CDN to cdn.example.com.

As a result, the user types the www.example.com address, from which they receive the HTML page, in the browser line. In this case, all static content, for example, graphic images, is loaded from the CDN (from the cdn.example.com address).