How can you download a certain file into a CDN before a client’s request?
Use the Prefetch feature, but we recommend it only for uploading large files. Please note that it is not possible to upload files in a CDN by following requests: /path/to/file/*.jpg, /path/to/directory/. This is due to the fact that files aren’t stored in CDN cache in a directory hierarchy. Instead, they differ from each other by unique file name hashes. In order to find files matching the wildcard or directory, the entire cache must be searched for matching files. It is a very slow operation, therefore we do not support it.
There is a limit on a file size, which can be cached by the CDN — 2 GB. File which is larger than 2GB will still serve through the edge servers but will not be cached. In any case if your pull files are larger than 200MB, we would suggest you to do a prefetch in advance for smoother delivery.
To prefetch content
- Go to CDN Resources in your Conrol Panel;
- Click the Resource Settings;
- Choose Prefetch;
- Specify the path to the file you want to upload;
- Press Prefetch.
- Or use our API.
Depending on files size, their quantity and servers overload it can take from 1 minutes to 15 minutes to populate the requested files on the CDN. The CDN can simultaneously preload 1000 files. If you prefetch more files, requests will be processed in order.