views:

71

answers:

2

I have an ASP.NET web application where a Microsoft Media Player object on the page (in IE) is issuing a request for an .aspx web page. In the page I use TransmitFile to send back the audio file. This works fine most of the time.

But, in some cases (a combination of IE version and a specific client, at least from what I can see) there is a second request issued, with the exact same URL. The only difference I can see between the first and second request is the user-agent value. The first request will have User-Agent: Windows-Media-Player/9.00.00.4508 and the second one will have User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)

This second request is causing the audio file to be sent a second time over the net, which is wasteful. This is what I'm trying to avoid.

I had a related question here, but in this case there is no Range request. It is just the same exact request again (same headers, except for the user-agent).

I was trying to suppress the second response (based on the user-agent in the header) with all kind of HTTP status responses (304, 404, 500 etc.) This works for some clients, some of the time, but breaks occasionally (the Media Player will just not play the audio, even though Fiddler will show it was transfered on the first request).

I would like to "convince" the browser to avoid the second request, if possible. As a second option I would like to find a response to the second request that will not break the playback, but avoid sending the whole audio buffer.

A: 

The only thing I can think of so far is that maybe they have a plugin/toolbar installed that is trying to do something when it detects media.

I think VLC does something like that for Firefox, and I know there are many 'video downloader' kind of addons for Firefox, maybe there are equivalents made for IE.

You could try asking the client that is having the problems to give you their list of addons (Should be Tools -> Manage Add-ons in IE8).

Hope this helps : )

EDIT: One more thing you could check is to ask them to try enabling compatibility mode on your site and see if it changes anything.

Nick Knowlson
I get this issue on multiple machines even in here (not only on customer machines). Some of them have vanilla IE fresh from install.
Ron Harlev
A: 

Please provide full headers dump, are you sure both requests are GET ones? First request might be just to check if the cached version is good enough.

Second thought: try to return 'expires' header to supress cache check.

BarsMonster
Can't get the headers right now. But they are both GET. Here is the IIS log: 2010-10-13 17:53:51 192.168.0.66 GET /sm62/controls/UMP/audioStream.aspx 200 Windows-Media-Player/9.00.00.45082010-10-13 17:53:51 192.168.0.66 GET /sm62/controls/UMP/audioStream.aspx 200 Mozilla/4.0+(compatible;+MSIE+8.0;+Windows+NT+5.1;+Trident/4.0;+.NET+CLR+1.1.4322;+.NET+CLR+2.0.50727;+.NET+CLR+3.0.4506.2152;+.NET+CLR+3.5.30729)
Ron Harlev