Connection: Qrator.CDN

Right in their Qrator Labs personal dashboard, customers can connect and configure the Qrator.CDN service.

Domain and certificate

To use Qrator.CDN, you need to set up your site such that a separate domain could be used for static content. User requests to this domain will be handled by Qrator.CDN, downloading it from your upstream and updating it as needed.

Qrator.CDN automatically creates for each site a domain that can be used for these purposes. However, customers often want static content to be hosted on their own domain, for example, a certain subdomain of the main domain. In this case, a CNAME record must be created in the appropriate DNS zone.

When accessing the domain via HTTPS, the certificate specified by the customer will be used. You can use any certificate pre-loaded in the certificate storage in your personal dashboard.

See the dashboard manual: Add an HTTP host, Add an HTTPS host.

Header settings

Although CDN does not modify the body of the content it caches (except for the optional image processing, see below), it is often necessary for CDN to add some sort of HTTP header to a user request or upstream response. Qrator.CDN can add arbitrary headers that are described in your dashboard.

Also, Qrator.CDN can specify the user's source IP address in a special header, whose name you can configure in your dashboard.

See the dashboard manual: Change HTTP header settings.

Blocked and white URL lists

The customer can set up a list of blocked URLs to which the CDN will respond with an error code without requesting content from the upstream. The specific error code is configured by the customer individually for each URL.

The customer can also create a list of white URLs, if necessary. In this case, CDN will request content only from URLs on that list and respond with an error code to all others. The default error code is 404 Not Found, but it can be overridden on a per-page basis using a blocked URLs list.

See the dashboard manual: Set Request URL policy.

Caching settings

Efficient caching is the main task of CDN, and it is important that it is done correctly, taking into account the content structure on the site. Therefore, the customer can configure how CDN will handle HTTP header Cache-Control in the dashboard, as well as enable or disable caching of certain types of errors. The customer can also enable CDN to ignore all GET request parameters. For example, this is handy if you rely on randomly generated GET parameters to force the browser to update cached content, but don't want that to result in extra requests from the CDN to upstream.

In some cases, it may be useful to remove some files from the cache after updating upstream content or making significant changes to caching settings. This can be done through your dashboard.

You can ask the Qrator Labs tech support team to force cache and update some content on the CDN (to perform the so-called CDN warmup) without waiting for the content to be first requested by users. This is useful if you have a lot of content updated on the source server. Without pre-caching, it may take longer for first time users to download new content because the CDN will not yet have cached content and the cache will fill up slowly.

See the dashboard manual: Change cache settings.

Processing images

For JPEG, PNG, TIFF, WebP and AVIF images (the types are detected based on the Content-Type header), Qrator.CDN can perform simple operations according to GET paramters in the user's request.

  • crop — crop the image.

    The GET parameter value must have the format x⟨NUMBER⟩,y⟨NUMBER⟩,w⟨NUMBER⟩,h⟨NUMBER⟩. The operation returns the contents of a rectangle that begins at the point (x,y) from the top left corner and has the size w×h.

    The example below instructs Qrator.CDN to load image.png from the upstream and return its fragment of the size 500×200 pixels, skipping 10 pixels on the left and 15 pixels on the top.

    https://cdn.example.com/image.png?crop=x10,y15,w500,h200
  • resize — scale the image.

    The GET parameter value must have the format w⟨NUMBER⟩ for scaling to the specified width or h⟨NUMBER⟩ for scaling to the specified height. The aspect ratio is kept unchanged when scaling.

    If the resize operation is used together with crop, the scaling is applied to the results of the crop operation.

    The example below instructs Qrator.CDN to load image.png from the upstream and return its copy, reduced or enlarged to the width of 300 pixels.

    https://cdn.example.com/image.png?resize=w300
  • format — convert the image to a given format.

    The GET parameter value can be one of the strings: jpeg, png, webp, avif. An optional parameter q⟨NUMBER⟩ (values from 1 to 100 are allowed) specified to the converter how close should the image quality be to the original. The real quality can vary depending on the selected format.

    The example below instructs Qrator.CDN to load image.png from the upstream and return its copy in the JPEG format with the quality level of 75.

    https://cdn.example.com/image.png?format=jpeg,q75

Note that when given invalid or incomplete set of parameters for an operation, Qrator.CDN will return the original image without modifications.

When using the crop or resize operation without the format operation, Qrator.CDN will return the image as JPEG or WebP (if Converting images to WebP is enabled).

Converting images to WebP

You can use auto-conversion of images to WebP to speed up the site. The WebP format provides a smaller file size with comparable image quality.

When auto-conversion is enabled, Qrator.CDN checks the Accept header in the request to determine of the user's browser supports WebP. If it does, the user is sent a WebP version of each images. The original versions of images remain in the Qrator.CDN cache. If the user's browser version does not support WebP, Qrator.CDN sends the original version of the image unchanged.

See the dashboard manual: Configure conversion of the images to WebP.

Transport settings

By default, Qrator.CDN serves the static content using the HTTP/1.1 protocol only. You can enable HTTP/2 to provide more efficient traffic through header compression, request multiplexing and some other techniques.

For both HTTP/1.1 and HTTP/2, you can choose the stream compression format to use. Qrator.CDN supports gzip, deflate, br and uncompressed streaming formats. You can switch between them in your dashboard.

See the dashboard manual: Change transport settings.

expand_less