Click Here to Install Silverlight*
United StatesChange|All Microsoft Sites
Windows Media Player 9 Series*
Search Microsoft.com for:
|Windows Media Worldwide

Caching and proxying content with Windows Media Services

Feedback
E-mail us with your comments and feedback about this article.
 
Abstract
This article describes how to use Windows Media Services to configure your Windows Media server as either an origin server or as a cache/proxy server to conserve bandwidth, decrease network-imposed latency, and offset the load on the origin server on your network.

 

David Nelson
Microsoft Corporation
September 2007
 

Applies to:
   Microsoft® Windows Media® Services 9 Series or later
 

Contents


Introduction

A cache/proxy server network conserves bandwidth, decreases network-imposed latency, and offsets the load on the origin server from which the content is published. Network bandwidth is minimized because only one connection from the origin server is required to upload content to and receive information from remote cache/proxy servers on the network. Latency is decreased because a client can receive content from a nearby cache/proxy server more quickly than it could if it had to traverse the network or the Internet to receive content from the origin server. Additionally, the load on the origin server is offset because fewer clients are connecting directly to it. These three factors result in a better viewing experience for users and operating cost reduction.

In the Windows Server 2003, Enterprise edition and Windows Server 2003, Datacenter edition operating systems, you can configure cache/proxy properties in Windows Media Services 9 Series to use your Windows Media server as an origin server that controls the behavior of remote cache/proxy servers during a streaming event. In the Windows Server 2008 operating system, you can configure a new, built-in WMS Cache/Proxy plug-in in Windows Media Services 2008 to use your Windows Media server either as a cache/proxy server or as a reverse proxy server so that it can provide caching and proxy support to other Windows Media servers.

Note
  • Cache/proxy functionality is not available if Windows Media Services is running on Windows Server 2003, Standard Edition.

Back to the top of this pageBack to Top


Caching and streaming on-demand content

The WMS Cache Proxy plug-in in Windows Media Services allows the server (the cache/proxy server) to cache on-demand content from another Windows Media server (the origin server). When a client requests on-demand content, the plug-in verifies that the content is cached locally and is current. To do this, it checks the cache expiration property of the content. If the content is set to expire at a time that has already passed, the plug-in requests that the cache/proxy server open a connection to the origin server and verifies that the content in the cache matches the content on the origin server. A cache hit occurs if the content matches; a cache miss occurs if the content does not match. If the origin server is unavailable or cannot provide the requested content, the cache/proxy server returns an error message to the client stating that the content cannot be found.

If a cache hit occurs, the plug-in requests that the cache/proxy server stream the content from its cache to the client.

Cache hit

If a cache miss occurs, the content is purged from the cache, and the cache/proxy server downloads updated content from the origin server. The cache/proxy server then initiates another connection to the origin server to act as a proxy server to deliver the content to the client.

Cache miss

Notes
  • If a cache miss occurs when the cache/proxy server tries to stream multiple-bit-rate (MBR) content, the cache/proxy server will try to download all of the different bit rate streams from the origin server simultaneously. If you have set a bandwidth limit for outgoing distribution streams on the origin server or a limit on the incoming bandwidth for the cache/proxy server, the aggregate bandwidth of the multiple-bit-rate stream may exceed these limits. If so, the cache/proxy server cannot download the content to its cache and will only stream the content at the bandwidth requested by the client.
  • If content was moved to a different location on the origin server, the cache/proxy plug-in can transfer client requests to the new location. For example, if the cache/proxy plug-in receives an HTTP code 301 or 302 when checking whether content is current, the plug-in updates its internal database to recognize requests for the new location.

Back to the top of this pageBack to Top


Proxying a live stream

The WMS Cache Proxy plug-in in Windows Media Services allows the cache/proxy server to proxy a live stream from an origin server through another Windows Media server. When a client requests a live stream, the plug-in checks whether the cache/proxy server is already proxying the stream. If the server is not proxying the stream, the plug-in requests that the cache/proxy server open a connection to the origin server. After establishing a connection to the origin server, the cache/proxy server streams the content from the origin server to the client. If the cache/proxy server is already proxying the stream, the plug-in requests that the server split the stream so that all requesting clients can receive the content. In this way, there is only one connection between the cache/proxy server and the origin server. The content is not cached because a live stream does not have a file associated with it.

Live broadcast from a cache/proxy server

Back to the top of this pageBack to Top


About reverse proxy

The WMS Cache Proxy plug-in in Windows Media Services allows the cache/proxy server to function as a reverse proxy server, which is a proxy server that is configured to be responsible for servicing all client requests. For a unicast broadcast, a reverse proxy server reduces the load on the origin server by streaming multiple unicast streams while receiving only one stream from the origin server. For on-demand content, a reverse proxy server reduces the load on the origin server by caching the content from the origin server and streaming it to clients from its cache.

To the client, the reverse proxy server appears to be the origin server. This enables you to isolate the origin server from clients. A reverse proxy server increases the security of your streaming media system because the client never connects to the origin server directly.

Reverse proxy distribution

Authentication for reverse proxy servers differs from that of conventional cache/proxy servers. When the client submits a request for content and authentication is enabled, the content must first be authenticated by the reverse proxy server. After the client is authenticated, the reverse proxy server submits a content request to the origin server and must be authenticated by the origin server before it can begin proxying the content to the client.

Reverse proxy authentication

To set authentication credentials for a reverse proxy server, do the following:
  1. On the reverse proxy server, run the following script. In this script, password is the password and user_name is the user name you want to use to authenticate the origin server:
    Dim server
    Set server = CreateObject("WMSserver.Server")
    Dim pp1
    Set pp1 = server.PublishingPoints.Item("Cache/Proxy Broadcast")
    pp1.DistributionPassword = "password"
    pp1.DistributionUserName = "user_name"
  2. On the origin server, configure the appropriate authentication plug-in to accept these values. For more information, see "Authentication category" in Windows Media Services Help.

Notes
  • A large number of unicast streams can place an enormous burden on the origin server. You can increase the reliability of your streaming media system by caching and delivering content from multiple reverse proxy servers. If only one reverse proxy server is used, there is the potential for a single point of failure in that system. By using more than one reverse proxy server, you can reduce the chance that the system will fail due to a reverse proxy server fault.
  • For more information about implementing reverse proxy, see the Windows Media Services SDK.

Back to the top of this pageBack to Top


Configuring cache/proxy plug-ins and properties

Windows Media Services includes plug-ins and properties that enable cache and proxy server support. You can use a Windows Media Server as a cache/proxy server or you can use a Windows Media Server as an origin server that controls the behavior of the remote cache/proxy servers during the streaming event.

If you choose to use the Windows Media server as a cache/proxy server on the network, you can configure Cache/Proxy Management plug-ins to configure the Windows Media server as either a cache/proxy server or a reverse proxy server for caching and proxying on-demand or live content. The WMS Cache Proxy plug-in is included in Windows Media Services for this purpose.

You can also choose to use the Windows Media server as an origin server on the network and configure properties to specify how long content streamed from on-demand or broadcast publishing points on the origin server to remote cache/proxy servers is valid before it must be refreshed. Cache/Proxy properties are used to specify the frequency with which remote cache/proxy server check for updated on-demand or broadcast content on the origin server.

This section contains the following topics:

Configuring a Windows Media Server as a cache/proxy server

The WMS Cache Proxy plug-in in Windows Media Services is used to configure a Windows Media server either as a cache/proxy server or as a reverse proxy server so that it can provide caching and proxy support to other Windows Media servers. This section describes how to enable and configure the plug-in.

This section contains the following topics:
Notes
  • When you configure the Windows Media server as a cache/proxy server by enabling and configuring the WMS Cache Proxy plug-in, default publishing points named Cache/Proxy On-Demand (for caching and streaming on-demand content from the origin server) and Cache/Proxy Broadcast (for proxying live content from the origin server) are created in Windows Media Services. These default publishing points allow you to monitor and configure additional properties for managing your Windows Media server as a cache/proxy server. For more information, see "About the Monitor tab for a publishing point" and About the Properties tab for a publishing point" topics in Windows Media Services Help.
  • Ports must be opened in the firewall on this server so that it can update content in its cache using a protocol that you select. For more information, see Firewall Information for Windows Media Services. In addition, on the origin server, the appropriate server control protocols must be enabled. For more information, see "Selecting data transfer protocols" in Windows Media Services Help.
  • Cache/proxy properties must be configured on the origin server to specify how often this server checks for updated content. For more information, see Configuring a Windows Media server as an origin server.

Enabling and configuring the WMS Cache Proxy plug-in

This section provides the following procedures for enabling and disabling the WMS Cache Proxy plug-in in Windows Media Services and for configuring properties for the plug-in on the cache/proxy server:
To enable the plug-in
  1. In Windows Media Services, click the server for which you want to enable the plug-in.
  2. In the details pane, click the Properties tab.
  3. In Category, click the Cache/Proxy Management category.
  4. In Plug-in, click WMS Cache/Proxy, and then click Enable.

To configure the plug-in properties
  1. Click the server for which you want to configure the plug-in properties.
  2. In the details pane, click the Properties tab.
  3. In Category, click the Cache/Proxy Management category.
  4. In Plug-in, click WMS Cache/Proxy, and then click Properties.
  5. Configure the plug-in properties described in the following sections.

To disable the plug-in
  1. In Windows Media Services, click the server for which you want to disable the plug-in.
  2. In the details pane, click the Properties tab.
  3. In Category, click the Cache/Proxy Management category.
  4. In Plug-in, click WMS Cache/Proxy, and then click Disable.

WMS Cache Proxy - General properties

The WMS Cache Proxy plug-in is used to configure this Windows Media server either as a cache/proxy server or as a reverse proxy server so that it can provide caching and proxy support to other Windows Media servers. You can configure the following options on the General tab for this plug-in.

WMS Cache Proxy plug-in - General properties tab

ItemDescription
Cache/Proxy Plug-in Status
Check the status box to determine the following:
Preferred Plug-in Protocol
Select a protocol to be used by this server when it updates content in its cache by streaming it from the origin server:
  • Client Protocol (default). Stream the content to the cache using the same streaming protocol that is requested by the client.
  • HTTP. Stream the content to the cache using Hypertext Transfer Protocol (HTTP).
  • RTSPU. Stream the content to the cache using Real Time Streaming Protocol (RTSP) in combination with the User Datagram Protocol (UDP) networking protocol.
  • RTSPT. Stream the content to the cache using RTSP in combination with the Transmission Control Protocol (TCP) networking protocol.

WMS Cache Proxy - Cache properties

You can configure the following options on the Cache tab for this plug-in.

WMS Cache/Proxy plug-in - Cache properties tab

ItemDescription
Enable Caching
Select this option to enable this server to cache content by streaming it from the origin server, if it must do so to fulfill a client request.
Cache Settings
Use the settings in this area to specify the following cache directory properties:
  • Limit Disk Quota (MB). Select this option and specify the amount of disk space available in the cache directory for storing cached content. If you specify a storage capacity for the cache directory, when the quota is reached, cached content will be deleted from the cache directory, beginning with the oldest item that has not been delivered to clients. If you do not specify a storage capacity for the cache directory and when there is insufficient disk space available for storing additional cached content, cached content will be deleted from the cache directory, beginning with the oldest item that has not been delivered to clients.
    Cached content actively being streamed by clients is marked for deletion and is deleted when the last user session ends. If another client requests cached content marked for deletion, this server will cache another copy of the content from the origin server to fulfill the request.
  • Limit Archive Quota per Stream (KB). Select this option to specify the amount of disk space available in the cache directory for storing any single on-demand file that is created from a live stream by the Play While Archiving feature.
  • Enable Freshness Check. Select this option to allow this server to check the cache expiration property of cached content when it is requested by clients. If the content is set to expire at a time that has passed, this plug-in opens a connection to the origin server to verify that the cached content is still current by comparing it to the content on the origin server. A cache hit occurs if the cached content matches; a cache miss occurs if the cached content does not match. If the origin server is unavailable or cannot provide the requested content, this server returns an error message to the client stating that the content cannot be found.
  • Enable Play While Archiving. Select this option to allow this server to start streaming content requested by clients without waiting until the content from the origin server is completely cached. A partially-cached file can be used as an on-demand source 60 seconds after caching starts.
  • Cache Directory Path. Select this option to specify the location on this server where cached content is stored. The default value is %systemdrive%\WMSCache.
Caching Speed
Select one of the following options that specify the speed at which this server caches content from the origin server, if it must do so to fulfill a client request.
  • Maximum Available Bandwidth. Choose this option to cache content from the origin server as fast as the network will allow.
  • Content Bit Rate. Choose this option to cache content from the origin server at the same bit rate as the requested content bit rate. Note that for multiple-bit-rate content, the caching speed is the same as the average bit rate of the content.
  • Kbps. Enter a value in this box to specify the bit rate at which this server caches content from the origin server.
Disk Usage
Use this information in this area to view how much of the disk quota in the cache directory is used by cached content and how much remains available for caching content. You can also click Clear Cache to empty the cache directory of all cached content.

Cached content actively being streamed by clients is marked for deletion and is deleted when the last user session ends. If another client requests cached content marked for deletion, this server will cache another copy of the content from the origin server to fulfill the request.

WMS Cache Proxy - Proxy properties

You can configure the following options on the Proxy tab for this plug-in.

WMS Cache/Proxy plug-in - Proxy properties tab

ItemDescription
Proxy
Select this option so that this server functions as a cache/proxy server for the origin server. To the client, the proxy appears to be the origin server.
Proxy Redirect
Select this option to redirect a client request to another server in an array of cache/proxy servers, and then type the name of the alternate server in the Alternate Proxy box.

You can use proxy redirection to balance loads, connect the client to a closer proxy, or send the client to content that has already been cached.
Reverse Proxy
Select this option so that this server functions as a reverse proxy server, and then, in the Content Server box, type the name of the publishing point on the server to which you want to forward the client request for content (for example, origin_server/publishing_point).

A reverse proxy server dedicates any incoming client request to a specific server and can be used for load balancing on a server farm.

WMS Cache Proxy - Prestuff properties

You can configure the following options on the Prestuff tab for this plug-in.

WMS Cache/Proxy plug-in - Prestuff properties tab

ItemDescription
Prestuff from Stream
Select this option to enable this server to cache content by streaming it from the origin server, even when it is not requested by clients.

Type the URL of the file on the origin server in the URL box (for example, http://server/publishing_point/file), and then select one of the following Prestuff Rate options that specify the speed at which this server caches content from the origin server:
  • Maximum Available Bandwidth. Choose this option to cache content from the origin server as fast as the network will allow.
  • Content Bit Rate. Choose this option to cache content from the origin server at the same bit rate as the requested content bit rate. Note that for MBR content, the caching speed is the same as the average bit rate of the content.
  • Kbps. Enter a value in this box to specify the bit rate at which this server caches content from the origin server.
Prestuff from File
Select this option to enable this server to make a file on an available file storage system, such as a local file system, storage area network (SAN), or network-attached storage (NAS), available for streaming to clients.

To copy the file from file storage to the cache directory on this server and make it available to clients before it is requested, do the following:
  1. Type the UNC path of the file in the Content Path box (for example, \\server\folder\file or network_share\file).
  2. Type the URL that clients must use to stream the file in the Stream URL box (for example, rtsp://server/publishing_point/file or http://server/publishing_point/file).
  3. Select the Copy content to local cache directory check box.
To copy the file from file storage to the cache directory on this server only after a client requests it, do the following:
  1. Type the UNC path of the file in the Content Path box.
  2. Type the URL that clients must use to stream the file in the Stream URL box.
  3. Make sure that the Copy content to local cache directory check box is not selected.
Note that this server cannot use freshness checking to determine whether the file in the file storage system has been updated. It the file has been updated, you must click Prestuff to cache the updated file to the cache directory.
Prestuff
Click this button to start caching the specified content from the origin server, even when it is not requested by clients.

WMS Cache Proxy - Query properties

You can configure the following options on the Query tab for this plug-in.

WMS Cache/Proxy plug-in - Query properties tab

ItemDescription
Query Entries Containing
Search for files in the cache directory on this server by entering the streaming URL of a file (for example, rtsp://cache_directory/file), and then click Query to display the file in the results list. To display multiple files in the results list, you can use the asterisk (*) wildcard character instead of the path or the file name or enter a partial URL (for example, enter rtsp to display all files that include the RTSP URL moniker or enter clip to display all files that include "clip" in the file name).
Delete
Select a file in the results list, and then click this button to delete the file from the cache directory on the cache/proxy server.

Cached content actively being streamed by clients is marked for deletion and is deleted when the last user session ends. If another client requests cached content marked for deletion, this server will cache another copy of the content from the origin server to fulfill the request.

Configuring a Windows Media server as an origin server

Properties in Windows Media Services are used to control the behavior of remote cache/proxy servers from the origin server during a streaming event. This section describes how to configure two categories of properties on the origin server so that you can control how content is streamed from on-demand or broadcast publishing points on the origin server to remote cache/proxy servers on the network.

This section contains the following topics:

Configuring Cache/Proxy properties

This section provides the following procedure for configuring cache/proxy properties when you use your Windows Media server as an origin server in a cache/proxy system:

To configure Cache/Proxy properties
  1. Click the publishing point on the origin server for which you want to configure cache/proxy properties.
    If you streaming on-demand content from the origin server, click the on-demand publishing point.
    If you are proxying live content from the origin server, click the broadcast publishing point.
  2. In the details pane, click the Properties tab.
  3. In Category, click the Cache/Proxy category.
  4. In Property, click Cache expiration (on-demand) or Stream splitting expiration (broadcast), and then click Properties.
  5. Configure the properties described in the following sections.

Configuring Cache expiration properties (on-demand)

You can configure the following options on the General tab for this property to determine the length of time that content streamed from on-demand publishing points on the origin server to remote cache/proxy servers is valid.

Cache Expiration Properties dialog box for on-demand publishing points

ItemDescription
After (seconds)
Select this option to have the remote cache/proxy server check this server for updated content after a specified number of seconds has passed. The default setting is 86,400 seconds (24 hours). If the content on this server is newer than the content on the cache/proxy server, the cache/proxy server will update its content.
Immediately
Select this option to have the remote cache/proxy server update its content from this server each time a client requests the content from the cache/proxy server.
Never
Select this option to have the remote cache/proxy server never update the content from this server. To update the content, the cache/proxy server administrator must request a new version of the content.

Note
  • You must ensure that the Enable caching by cache/proxy servers property for the on-demand publishing point is enabled to allow a cache/proxy server to cache the content locally and stream the content to clients from the cache rather than from the origin server. To enable this property, do the following:
    1. Click the on-demand publishing point on the origin server for which you want to enable this property.
    2. In the details pane, click the Properties tab.
    3. In Category, click the General category.
    4. In Property, click Enable caching by cache/proxy servers, and then click Enable.

Configuring Stream splitting expiration properties (broadcast)

You can configure the following options on the General tab for this property to determine the length of time that content streamed from broadcast publishing points on the origin server to remote cache/proxy servers is valid. Note that remote cache/proxy servers in this configuration are sometimes called stream-splitting servers.

Stream Splitting Expiration Properties dialog box for broadcast publishing points

ItemDescription
After (seconds)
Select this option to have the remote cache/proxy server check this server for updated content after a specified number of seconds has passed. The default setting is 86,400 seconds (24 hours). If the content on this server is newer than the content on the cache/proxy server, the cache/proxy server will update its content.
Immediately
Select this option to have the remote cache/proxy server update its content from this server each time a client requests the content from the cache/proxy server.
Never
Select this option to have the remote cache/proxy server never update the content from this server. To update the content, the cache/proxy server administrator must request a new version of the content.

Available to broadcast publishing points only. Enable this property to allow a cache/proxy server to distribute the broadcast stream to multiple clients from the cache rather than from the origin server.

Note
  • You must ensure that the Enable stream splitting property for the broadcast publishing point is enabled to allow a cache/proxy server to distribute the broadcast stream to multiple clients from the cache rather than from the origin server. To enable this property, do the following:
    1. Click the broadcast publishing point on the origin server for which you want to enable this property.
    2. In the details pane, click the Properties tab.
    3. In Category, click the General category.
    4. In Property, click Enable stream splitting, and then click Enable.

Back to the top of this pageBack to Top



© 2008 Microsoft Corporation. All rights reserved. Contact Us |Terms of Use |Trademarks |Privacy Statement
Microsoft