internet-explorerhttp-headersflashosmf

Caching issue with Flash Player 11.7


Short-version:

Our Flash app is live-streaming video from our CDN, starting with the recent release of Flash Player 11.7

Background:

We have a Flash app that runs in the browser. We see the problem with IE 8, 9, 10, on Windows XP and Windows 7. Both 32-bit and 64-bit.

When our app makes a request for video to our CDN, the browser refuses to cache it, and it is causing high network traffic. Caching worked well in Flash Player 11.6.

Issue:

Using Fiddler, we have contrasted the HTTP requests in the good and bad cases. The only difference is that, with Flash Player 11.7, the raw request contains:

Pragma: no-cache

I realize that this is implementation specific and not supported. Note that we don't want this.

We are using the OSMF framework (version 2.0) and have access to the source.

Code:

The specific code (abstracted considerably):

resource = new URLResource(url);
player = new MediaPlayer();
factory = new DefaultMediaFactory();
element = factory.createMediaElement(resource);
player.media = element;

Question:

Does anyone have a fix for this?

Ideas include:

Sadly, using a different browser is not an option for us.


Solution

  • In short, the following worked for us:

    Change this:

    var playerResource:URLResource = new URLResource(url); 
    

    to this:

    var playerResource:StreamingURLResource = new StreamingURLResource(url); 
    playerResource.streamType = StreamType.LIVE_OR_RECORDED;
    

    In detail, we know that OSMF 2.0 did not change between Flash 11.6 and Flash 11.7. However, it seems as though the interpretation of the default value of streamType did change, possibly by accident. Flash 11.7 treats the default as though it is a "live stream" and does not cache.

    By specifying streamType explicitly, things go back to normal. There is no "Pragma: no-cache" in the HTTP request. Our app calls out for the video once, and then it is cached. This fix also works in the original env, Flash 11.6.