Learn how to use Wowza Streaming Engine™ media server software as an origin to an HTTP caching infrastructure for HLS playback with the ability to track client sessions. Third-party HTTP caching proxies that are configured to cache video content can re-stream the content from the Wowza Streaming Engine origin application. This article describes how to configure a streaming application to accomplish this.
- The configuration described in this article is different from the HTTP Origin mode configuration described in Configure Wowza Streaming Engine as an HTTP caching origin and does not use the Live HTTP Origin or VOD HTTP Origin application types. With Live HTTP Origin or VOD HTTP Origin applications, Wowza Streaming Engine serves as an origin to an HTTP caching infrastructure for delivery to players with all HTTP protocols, but you can't track client sessions. If your workflow requires tracking client sessions or only needs to use an HTTP caching infrastructure for delivery to players with HLS—and not other HTTP protocols—you can use the configuration described in this article.
- A license with support for HTTP Origin mode is required. This functionality is not available in Trial and Developer editions of Wowza Streaming Engine.
About session-based HTTP caching and tracking client sessions
In contrast to sessionless Live HTTP Origin or VOD HTTP Origin applications, when using other application types (Live, VOD, Live Edge, or VOD Edge) as an origin to an HTTP caching infrastructure for HLS delivery, communication with the Wowza Streaming Engine origin is session based. Every media playlist request creates a session. With session-based communication, using URL query parameters in player requests is supported, and session-specific information, such as connection counts, can be retrieved from Wowza Streaming Engine to track client sessions.
Session-based HTTP caching is possible by only caching the video segments and not the media playlist or master playlist (manifest) that reference the segments. When HLS client players request a media playlist, the request goes directly to Wowza Streaming Engine. Because segments contain most of the media data for a stream, you get the greatest scalability benefit with caching the segments, and the origin server should not be significantly burdened by the unique media playlist or master playlist requests.
The Wowza Streaming Engine session identifier (_wXXXXXXXXX) is returned with media playlist and master playlist data. A stream's segments do not contain unique session IDs like the media playlists or master playlist and are reused across unique sessions with every client request for a media playlist as a result.
With either session-based or sessionless HTTP caching for live streaming, the edge is an HTTP caching infrastructure, not another Wowza Streaming Engine server. The edge HTTP caching infrastructure pulls HTTP segments from your Wowza Streaming Engine HTTP caching origin and caches them. For VOD streaming, Wowza Media Cache can also serve as the HTTP caching edge. To learn more about Media Cache, see Scale with Wowza Streaming Engine Media Cache.
Configure the HTTP caching proxy as a Wowza Streaming Engine edge
Before you configure the origin application, you should start configuring the HTTP caching proxy that will be used as the edge. Types of HTTP caching proxies you can use include regular HTTP proxies, such as Squid, Apache, or Nginx; cloud-based caching services, such as Amazon CloudFront; third-party CDNs, such as Akamai or EdgeCast; and Wowza Media Cache for VOD applications.
Generally, you must provision a regular HTTP proxy manually ahead of time to connect to Wowza Streaming Engine. You may also need a load balancer to distribute the player connections evenly between the HTTP proxies in the cluster. By default, most regular HTTP proxies are designed to cache webpages, which are usually much smaller than a video stream. The proxies must be configured to cache video. If this isn't done, the proxy does not cache the video content, and every player request goes to Wowza Streaming Engine, negating the advantages of caching.
Configure the Wowza Streaming Engine HTTP caching origin application
Next, create an application to use as an HTTP caching origin for HLS playback with the ability to track client sessions.
- In Wowza Streaming Engine Manager, click the Applications tab, and then click Add Application in the contents panel.
- On the Add Application page, select one of the following application types: Live, Live Edge, VOD, or VOD Edge.
- In the New Application dialog box, name your application and click Add.
- Click Save to save the application with default values.
Note: Apple HLS must be selected as a playback type. Any other selected Playback Types will not use the HTTP caching infrastructure. Player requests for protocols other than HLS will be sent directly to Wowza Streaming Engine, not the HTTP caching proxy.
- Click the Properties tab for your application.
- In the HTTP Streamers Cupertino Settings section, click Edit.
- For the cupertinoCacheableSegments property, select the Enabled checkbox and set the Value to True.
Note: You can also enable the cupertinoCacheableSegments property in the Wowza Streaming Engine XML configuration. Using a text editor, open the Application.xml file for your origin application from [install-dir]/conf/[application name] and add the following property to the <HTTPStreamer>/<Properties> container.
<Property> <Name>cupertinoCacheableSegments</Name> <Value>true</Value> <Type>Boolean</Type> </Property>
- Click Save, and then restart the application to apply any changes.
Test the origin-edge configuration and HLS playback
After you create your origin application, you need to configure your HTTP caching proxy edge to use the Wowza Streaming Engine origin. This configuration depends on the HTTP caching proxy you use. You can test playback of a stream using the HTTP cache with a unique URL generated by the HTTP caching proxy edge for HLS players and the the HLS test player on the Video Test Players webpage.
For more information about HTTP caching technologies, see: