Sunday, March 18, 2007

This strange issue with IE and SSL has been bugging me. I found the time to do some testing on this. If you're using Pragma no-cache on your web server with SSL and Flash and are scratching your head trying to figure out why you can't see your data then continue reading.

Problem: I make a request from Flash to an XML file that's located on my web server with https (SSL). I can see the XML when I make the request from my IE however when I use the Flash Player with the load.xml method it fails to return results. To make matters worse things work just fine with FireFox, but not with IE. When using IE I don't see the XML results returned to Flash. When I use Charles to see what's going on... I can see that the XML is returned to the browser. Is this a Flash issue ? Or is this IE ?

Solution: Just modify the "Pragma" to use must-revalidate along with no-cache. If you make it look like the following below it should work just fine. You need to modify the headers on the server that is serving the XML document.

If you have this Pragma: no-cache
Change it to this Pragma: no-cache,must-revalidate

Why? It's my theory the response hand off from IE to the FlashPlayer is the cause. Should the response be considered stale by IE then the cache (XML data) will need to be revalidated with the server before Flash can get it. This seems to be an issue with the Pragma header and not the Cache-Control header and I'm not sure why.

Here is the rfc2616 w3c spec on cache control settings.

No comments: