Lazy import - Video CDN [EN]
This mode is ideal for projects with large content libraries where preloading all assets into the CDN is either cost-prohibitive or technically impractical. The key advantage - files are imported based on real user demand, as a result, storage resources are used more efficiently, helping to optimize overall costs.
Lazy Import is used in a special strategy for processing requests to non-existing files, for on demand pulling the files. The list of files for import is generated by a special script.
The script anasyles access logs and searches for requests that were successfully proxied to the origin. These records are used for creating demand list, which is used for scheduling the further import:
Once the import process is complete, files become served directly from the CDN storage. Proxying is no longer required and delivery returns to main operational mode.
The import duration depends on file size but in most cases does not exceed 10 minutes.
Lazy import requires the origin to support file delivery over the HTTP protocol. The CDN relies on standard HTTP requests to fetch and import content while proxying works.
Fine tune
In addition to specifying the origin URL, used by the CDN to proxy requests for unavailable files until they are fully imported, you can configure several advanced parameters to fine-tune the import process:
Alternative download URL. Instead of proxying, you can define a direct URL for file downloading. If your origin has bandwidth limits for uploads, we recommend creating a dedicated virtual host or
location {}block without rate limiting, and specifying that URL here to accelerate imports.Nginx SecureLink settings. If your origin is protected by the
nginx_securelinkmodule, you can configure the CDN to generate compatible tokens. However, since the CDN already validates access using its own mechanisms and never exposes your origin URL, we generally recommend disablingnginx_securelinkon the origin to prevent import issues.Import activation thresholds. By default, file import is triggered on the first request. You can change this behavior by setting:
A minimum number of requests per minute required to trigger import.
A minimum interval (in seconds) between two requests for the same file, which can help filter out sporadically accessed content. This helps optimize storage usage and reduce unnecessary CDN load for rarely accessed files.
Minimum file size for import. Set a threshold to avoid importing small or insignificant files.
Allowed file extensions. Restrict imports to specific file types.
Filename exclusion patterns. Define templates to exclude files from import based on name patterns. These files will still be proxied, but not stored on the CDN.
See also
Requests to non-existing files
Strategy for serving the requests to non existing files
How to lazy import files using proxy url
Guide for setup import