Using Windows Media Services 2008 Cache/Proxy plug-in


One of the main differences between Windows Media Services 9.1 on Windows 2003 and WMS 2008 on Windows Server 2008 is the inclusion of the Cache/Proxy plug-in.  In WMS 9.1 you had to compile (and write some of your own code to do caching) to have cache/proxy functionality.  WMS 9.1 also required that use have the Advanced Server SKU of 2003 to be able to use custom plug-ins.  With Windows Server 2008, even in the Standard SKU, the cache/proxy plug-in is included.


The first step in understanding how to configure the Cache/Proxy plug-in is to find it.  It’s not in the most obvious place in WMS.  It is not in this location:



 Proxy config is not located here


 


The above section is primarily for administering how the plug-in handles client connections.  Typically this is not something you need to configure at all since much of the focus on proxy configuration is dealing with the upstream connections.  Instead, you want to go up to the server level.  On the Properties tab you will see Cache/Proxy Management.  If you select this plug-in you will see WMS Cache Proxy on the right.  This is where you do most of the cache/proxy administration.  Since it is disabled, you will need to enable it to turn your server into a WMS Cache/Proxy server.  Here’s where to find it:



 Cache Proxy 2 - Configure the proxy here


All right, now we can actually configure the cache/proxy.  Go to Properties on the plug-in.


The first thing that you need to decide is the type of proxy that you are setting up.  I’m going to ignore the Proxy Redirect type for the purposes of this article and focus on Proxy and Reverse Proxy.  First, just to keep things a bit more clear I’m going to now refer to the term “Forward Proxy” instead of Proxy to contrast against the Reverse Proxy type even though you won’t see “forward proxy” referenced in the help docs.


 


Forward Proxy


A Forward Proxy is probably the easier of the two proxy types to understand because many people have already implemented something similar with a typical web proxy (such as Microsoft ISA server).  This type of proxy allows internal network clients to use a common access point for requesting content from the Internet.  The Forward Proxy is a “client focused” proxy where the main purpose is to save bandwidth on the client’s connection to the Internet.


You configure the Forward Proxy on the Proxy tab in the WMS Cache Proxy Properties dialog.  You simply select “Proxy” for the type of proxy.  That’s it.


Cache Proxy 3 - Forward Proxy config



With a Forward Proxy you would configure each Windows Media Player client (more on this later) to point to the Forward Proxy.  The Forward Proxy could be in a DMZ or be configured to be dual-homed so that one side is connected to the internal network and one side is connected to the Internet.  Here is a typical configuration:


 


Cache Proxy 4 - Forward Proxy network diagram



When a client is requesting content from the Internet, instead of making the request directly from the client to the Internet based WMS server, the client sends the request with the full URL to the WMS Cache/Proxy server.  This cache/proxy in turn makes the request to the Internet WMS server on the client’s behalf.  The cache/proxy then caches the content (if enabled) and sends the content to the client PC.  If another client requests the same URL, the content is served from proxies cache instead of using Internet bandwidth to get the file.  This can save quite a bit of network bandwidth upstream from the cache/proxy.  Again, this is very similar to the way you would setup a web proxy server such as ISA.


Because the forward proxy can work with any upstream or origin server (Internet based or internal server), you must configure Windows Media Player to point to the server acting as the WMS cache/proxy.  There are two main ways to do this.


 


Manual Location Configuration


This is done in Windows Media Player by going to Tools/Options/Network and configuring both HTTP and RTSP to point to the WMS cache/proxy.


Cache Proxy 5 - WMP proxy settings



In this dialog you would click on the Configure… button and choose the Use the following proxy server radio button and put in the proxy name or address.  Do this for both HTTP and RTSP since the WMS cache/proxy supports both protocols.


Using Group Policy to set the proxy


If your clients are joined to Active Directory then you can use Group Policy to push down a policy to configure Windows Media Player’s proxy settings.  This is very similar to the way you can push down the proxy settings for Internet Explorer.  Run the Group Policy Editor by going to Start/Run and typing in: gpedit.msc.  Navigate to User Configuration\Administrative Templates\Windows Components\Windows Media Player\Networking.  You can then configure the proxy settings for RTSP, HTTP, and MMS similar to how you configured it in Windows Media Player.


 


Reverse Proxy


By contrast, the reverse proxy is a more “server focused” proxy.  This is typically used for a Content Delivery Network (CDN) type of setup where you have a number of servers that you are load balancing to handle a large client load.  Instead of manually replicating on-demand content to each edge server or configuring each edge server for a live stream you can use a reverse proxy to “mirror” the content on an origin server.  Configure each of the reverse proxies to point to the origin server (via name or IP address) on the Proxy tab in the WMS Cache Proxy Properties.  Select the Reverse Proxy radio button.  Note that you can only specify one origin content server. 


Cache Proxy 6 - Reverse proxy settings



When a client makes a request to the reverse proxy the proxy checks its cache to see if it can serve the request locally.  If it cannot then it requests the content from the origin server, caches it locally, and sends the content to the client.  If the client is requesting a live stream then the reverse proxy will use a single connection back to the origin.  The proxy then splits the live stream so that multiple clients can view the stream even though only one connection is made back to the origin server.  Here is a typical reverse proxy setup:


 Cache Proxy 7 - Reverse Proxy network diagram


 


With a load balancer in front of the three reverse proxies in this diagram the three serves can handle much more load than a single server.   Note that typically the load balancer will expose a single URL to the client so that all three servers may appear as one address.


 


Capabilities




























Feature


Forward Proxy


Reverse Proxy


Client configuration required


Yes


No


Can load balance proxies


Yes


Yes


Can proxy to any WMS server


Yes


No


Meant for corporate environments 


 Yes


 No


Meant for CDNs


 No


 Yes


 


 


Gotchas


·        While it is possible to use multiple tiers of reverse proxies, not all tiers will cache content or split streams.


·        Make sure you check the Limit Disk Quota box on the Cache tab.  Otherwise you may end up running out of disk space.


·        If you use server-side playlists on the origin server, the content will not be cached on a proxy.  This is because the proxy cannot predict the behavior of the server-side playlist.


·        Reverse proxies do not pass authentication requests from the origin to the client.  If you need to do authentication, then do the authentication on the reverse proxy itself.


·        When a server is configured as a reverse proxy, the local publishing points are no longer accessible.  The reverse proxy truly mirrors the origin server.


 


References


Caching and proxying content with Windows Media Services
http://www.microsoft.com/windows/windowsmedia/howto/articles/cache_proxy.aspx


 

Comments (2)

  1. andy_s says:

    Hi Random, I wonder if you could help me with a issue I have.

    I have a back end WMS machine configured to use a dynamic source for its publishing point.

    I can call that machine with a URL like this:

    mms:\machine1smil6?QueryString=1234

    The server then passes the query string to the dynamic source, and all is well.

    However, when I add a second WMS server and configure it as a reverse proxy, when I call it like this:

    mms:\machine2smil6?QueryString=1234

    It seems to drop the Query String from the request it makes to the back end server.

    Have you come across this problem?  I am tearing my hair out trying to get this working.

    Thanks for your time.

  2. RandomNumber says:

    Yes, I’ve seen this before.  Unfortunately I’ve not been able to come up with a workaround.