- A user creates their own online storage for distributing static content from a direct link (such as cdn.domain.ru, where domain.ru is the user’s domain, and all static content is located in the cdn subdomain). In this case, we can ignore the default domain by writing a CNAME entry for it and writing cdn.domain.ru everywhere.
- In the Selectel control panel, the user enables the CDN service, enters their subdomain as the content origin, and is then assigned a ***.selcdn.net subdomain. The user has to configure their server, which is responsible for distributing static content, to process requests from their sub domain. For example, if you use Nginx, follow these instructions.
In their site settings, the user has to enter ***.selcdn.net instead of cdn.domain.ru when linking to static content. For example, if the file image.png is located on the origin in a folder named “content”:
- original link: cdn.domain.ru/content/image.png;
- new link: ***selcdn.net/content/image.png.
When using the second link, cached content will be sent directly from the CDN provider’s server. If the object has not been cached, it will be requested from origin (cdn.domain.ru), moved to the cache, and then sent from the CDN server. Transfers operate as follows:
- A user requests content from a site.
- The CDN provider chooses the CDN edge server that can deliver the content at the fastest speed.
- If content has not been cached on the server, the CDN (***.selcdn.net) will retrieve it from the origin (cdn.domain.ru).
- Future users from neighboring areas will receive content from the CDN server.