Preload files for the Media Cache system with a Wowza Streaming Engine server listener

The MediaCachePreload server listener for Wowza Streaming Engine™ media server software lets you specify on-demand video files to preload into the Media Cache before first playback.


For developers
More resources


Wowza Streaming Engine™ 4.0.0 or later is required.


  1. Download
  2. Extract the contents from the downloaded (zipped) package, and then copy the lib/wse-plugin-mediacachepreload.jar file from the package to the lib folder in your Wowza Streaming Engine installation ([install-dir]/lib).
  3. Restart Wowza Streaming Engine.


To enable the server listener, add the following server listener definition to your server configuration. See Configure server listeners for details.

Base Class


After enabling the server listener, you can adjust the default settings by adding the following properties to your server. See Configure properties for details.

/Root/Server mediaCachePreloadApplication String vod-edge Name of the Media Cache application. Use the default or an application name that includes the stream type of the file; otherwise, Streaming Engine will use the first application it finds in your applications folder. (default: not set)
/Root/Server mediaCachePreloadTargetPath String ${com.wowza.wms.AppHome}/conf/mediacachepreloadtargets.txt Path where your target text file (.txt) is stored. If the text file is in a non-standard location (outside of the project default /conf folder), specify that path here. (default: ${com.wowza.wms.AppHome}/conf/mediacachepreloadtargets.txt)
/Root/Server mediaCachePreloadLoadType String defaultBlockSize Type value that affects how the mediaCachePreloadLoadValue property is used, either defaultBlockSize or bytes. (default: defaultBlockSize)
/Root/Server mediaCachePreloadLoadValue Integer 3 Number of blocks to load into the Media Cache. If the mediaCachePreloadLoadType is defaultBlockSize, Streaming Engine preloads this number of blocks into the Media Cache. If mediaCachePreloadLoadType is bytes, this number of bytes is loaded into the Media Cache. This setting can be overridden for individual files in the target's file (see below). (default: 3)
/Root/Server mediaCachePreloadContentsDisplayInterval Integer 5000 Time, in milliseconds, to wait between a Media Cache contents dump within the logs. (default: 5000)
/Root/Server mediaCachePreloadThreads Integer 5 Size of the thread pool used for preloading the Media Cache. (default: 5)
/Root/Server mediaCachePreloadDebugLog Boolean true Flag that enables or disables extra debug logging. (default: false)


You can define a list of files that you want to preload in the [install-dir]/conf/mediacachepreloadtargets.txt file. As long as Wowza Streaming Engine is running, it will preload the listed files into Media Cache, as requested.

You can update this file at any time while Wowza Streaming Engine is running to preload new cache items as needed. Each file to be preloaded must be specified on a new line in the target's file. Empty lines and comments (lines starting with "#") are ignored.

Files must be defined with the full path as shown in the following example:

#[prefix]:[mediacache-prefix]/[path-to-file]		[preload-value]
#[preload-value] is optional and will override the mediaCachePreloadLoadValue property.

# s3 example. load entire file
mp4:amazons3/123456/test/myfile.mp4	-1

# NAS example. load 5 blocks
mp4:content1/sample.mp4		5

If you set the preload-value to -1, the entire file is preloaded.

If you set the preload-value to 1 or greater, that number of blocks or bytes, depending on the mediaCachePreloadLoadType property setting, is preloaded.

For developers

  • Get the source code on GitHub

More resources