mx:HTTPService calls are cached in IE 6 unnecessary

November 23rd, 2006

Usually, mx:HTTPService is defined in MXML in the following way:

<mx:HTTPService id="accountsRequest"
      method="POST" url="accounts.php"
      result="assignUsersData(event)" fault="onErrorLoad(event)">

Such a HTTP request works flawlessly in Firefox browser, but in IE6 after first call the results of HTTP get cached and a new call to the remote destination never occur. The same issue is discussed at Adobe Flash Player 9 forums.My solution to prevent caching of HTTP requests in IE is to add foo variable to the url of HTTP Service that equals to the random value.

private function changePage(pageIdValue : Number) : void 
      var rnd : Number = Math.round(Math.random()*1000);
      accountsRequest.url = "accounts.php?foo=" + rnd;
      pageId = pageIdValue;