The interface of the File Manager Properties window allows you to manage the parameters of existing files, but the changes you make will not apply to new files. You will have to specify the parameters for them separately. You can use the profiles feature to create rules that will automatically apply to files you create in the future.
Profiles set the parameters of new files in accordance with a regular expression that checks the path and name. The following options are available:
- maximum speed,
- start of speed limit,
- file availability,
- availability of the intermediate page when downloading the file,
- header - Content-Attachment (view in browser),
- placement zones.
Features of work
The values of the profile field are a regular expression that will be applied to the path and file name. Triggering of this expression will cause the specified parameters to be applied.
Note: the Profile field accepts only regular expressions of the form video/.+\.mp4 (this example will apply to all files with the mp4 extension in the video folder).
The Apply to existing files option allows you to skip managing the parameters of individual files and create bulk transfer rules.
At any given time, only the one profile with the highest priority applies to the requested file.
Suppose we want to create a rule for newly created mp4 files at 480p resolution and 2.5mbit/s bit rate for video and 128kbit/s for audio.
For this we create a new profile - /video/.*480\.mp4
Set speed limit, to do so reduce bitrate to kilobit/s by adding 10% speed margin
(2.5*1024+128) * 1.1 = 2956,8 ~ 2957 kbit/s;
Let's set the time of speed limit response to be equivalent to the first 20 seconds of video, to do this we convert the obtained speed limit to kilobytes and multiply by the time:
2957 * 20 / 8 = 7392,5 ~ 7392 KB.
Configure file availability - let's make it accessible only by signed link, with browsing instead of downloading.
Specify London and Sydney as zones for the file.
Done, now mp4-files in the folder and subfolders /video/ with the name *480.mp4 will automatically get speed limit enabled after downloading ~20th second of video and available only with signed link when placing in 2 zones of ZeroCDN.