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).
You can set cache headers 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:
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.
- 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).
- 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.