By default, if your stream is in HLS format, we will just proxy it through CDN-servers to the end-users.
To configure the service:
- Create a CDN resource in the control panel
- Configure cache settings for playlists (.m3u8) and video segments (.ts).
- If you set a Live streaming, configure file caching through RAM.
Cache settings for playlists and video segments
You can set cache settings for playlists (.m3u8) and video segments (.ts). either on your origin or in the control panel.
Origin setup recommendations:
For video segments (.ts) set the Cache-Control HTTP header to 1 minute (the time of caching should be a little bit longer than the length of a video segment (.ts)) By default, CDN servers inherit all HTTP headers from your origin and follow the stated directives. Do the same for playlists (.m3u8), but set the Cache-Control HTTP header to 1-2 seconds.
Control panel setup recommendations:
1. Configure a personal account
For video segments (.ts). Go to the settings of the CDN Resource that you plan to use for a broadcasting. Click on "Show advanced settings" and navigate to the "Cache" settings.
Add the option "CDN Caching" and select "CDN controlled" where you are to specify "Cache Expiry" equals 1 minute.
Add option "Browser Caching" and select "CDN controlled" where you are to choose the point "Do not cache" for the "Cache Expiry" parameter.
For playlists (.m3u8). Go to the "Rules" section and click on the "Add rule" button.
Put any name in the "Rule name" field.
Choose "Regular Expression" and specify the following pattern: .*\.m3u8$
Navigate to "Cache Settings":
Add the option "CDN caching" and select "CDN controlled" where you are to specify "Default Cache Expiry" -> "Custom Value" -> set 2 seconds.
2. Integrate the stream with the CDN.
Change your domain address in URLs to your CDN domain name. Check CNAME settings beforehand.
For example, a stream URL from origin: http://domain/playlist.m3u8
The stream URL from CDN: http://cdn.domain/playlist.m3u8
You can check your stream in any player that supports online HLS streaming (for example, VLC).
3. If you plan to stream Live, contact our technical support (firstname.lastname@example.org) to configure file caching through RAM. The setting will help to speed up the content delivery from the CDN and also prevent possible delivery failures.
Important! If you plan to stream VOD, please, skip this step.
4. Share your stream
Publish the updated stream URL on your website.
If you expect more than 100 viewers from different locations, we strongly recommend you to activate origin shielding to reduce the load on your origin.
How to configure file caching through RAM
In order to configure file caching through RAM instead of through hard drives, go to the CDN-resources, click the arrow sign next to the resource for Live streaming and choose Turn on LIVE STREAMING preset.
To turn off the preset, go to the CDN-resources, click the arrow sign next to the resource for Live streaming and choose Turn off LIVE STREAMING preset.