1 Reply Latest reply on Oct 12, 2007 2:25 AM by Yannick Lacaute

    [Filereference.download] IE cache problem

    Yannick Lacaute
      Hi,
      I try to download a file, from the server to the client, with the FileReference object. The file content changes dynamically on the server but the URL is still the same.

      There is no problem with Firefox, but with IE, because of its cache management, I get always the same file content. So, there are different solutions (IE options, etc.) but some people have said to me that the best one was to put some specific headers in the HTTP request like below :

      <code>
      var header1:URLRequestHeader = new URLRequestHeader("CacheControl", "no-cache");
      var header2:URLRequestHeader = new URLRequestHeader("Pragma", "no-cache");
      var header3:URLRequestHeader = new URLRequestHeader("Expires", "-1");

      request = new URLRequest(url);
      request.requestHeaders.push(header1);
      request.requestHeaders.push(header2);
      request.requestHeaders.push(header3);
      file = new FileReference();
      file.download(request);
      </code>

      So, is it the good solution to my problem ? and why I don't see the specified header in the download request ? (with a HTTP packet analyzer)

      Thanks a lot for your help !