CDN resource
A resource is the main logical entity in Yandex Cloud CDN that lets you configure and manage content distribution from origins over a CDN.
To start distributing content over a CDN, create a resource by following the instructions and specify the following in it:
- The origin or origin group that hosts your content.
- Domain names for content distribution.
- Basic settings for exchanging data between clients and the CDN and between the CDN and origins.
After creating a resource, you can also configure for it:
- Caching.
- HTTP headers and methods (see the instructions).
- Processing of cross-domain queries (CORS).
- Compression and segmentation of content.
It may take up to 15 minutes for the new resource settings to apply to CDN servers. After that, we recommend purging the resource cache.
Domain names for content distribution
Domain names for content distribution are used in client requests to CDN servers. For example, to make the file styles/common.css
available at cdn.example.com/styles/common.css
, you need to enter cdn.example.com
as a domain name.
Cloud CDN supports any domain names, including IDN with local non-ASCII characters, for example, Cyrillic. Now you can specify the name in the original form (пример.рф
) or transform them to Punycode with the xn--
(xn--e1afmkfd.xn--p1ai
) prefixes added. In the management console, resource details show IDNs in the original form with no transformation to Punycode.
When creating a resource, you must enter at least one domain name. The first name you enter is the primary domain name, and you can't change it after you create a resource.
For the resource to run properly, you must have:
-
Rights to all the domain names you entered.
-
Access to DNS settings for domain names.
For each name, in the settings of your DNS hosting, you must create a CNAME record linking this name with the domain name of the CDN load balancer, in the format
cl-<random characters>.gcdn.co
. It's displayed when creating a resource and also in the management console (on the page of an existing resource). This is a sample record for thecdn.example.com
domain name:cdn.example.com. CNAME cl-4sne12sd.gcdn.co
Resource usage statistics
Cloud CDN provides resource usage metrics for the last 30 days:
- Upstream from origins: The volume of traffic streamed by CDN servers from origins.
- Sent: The volume of traffic sent from CDN servers to clients.
- All traffic: The sum of the metrics Upstream from origins and Sent.
- Requests: The number of client requests to the CDN.
- Responses hit: The number of client requests that were responded by CDN servers with cached copies of files without requesting them from origins (if caching is enabled for CDN servers).
- Response miss: The number of client requests that were not responded by CDN servers with cached copies of files (for example, because caching was disabled, the file hasn't been cached by the server yet, or the cache lifetime expired) and CDN servers had to access origins to load files.
- Cache hit ratio: The ratio of traffic sent from CDN servers to clients without accessing origins. It's calculated using the formula
(1 − (Upstream from origins / Sent)) × 100%
. - Uploaded by shielding server: Amount of traffic uploaded by shielding server from origins (if shielding is enabled).
- Responses with 2xx codes, 3xx codes, 4xx codes, 5xx codes: The number of responses with those HTTP status codes sent by CDN servers to clients.
You can view statistics on the resource page in the management console.