6 Replies Latest reply on Apr 22, 2008 1:43 PM by savyasachi

    IE CACHE PROBLEM NEED HELP ASAP

    nivla17
      Every flex 2 app I make is being cached by IE! Works fine on FireFox, but everytime I run it in IE I need to dump my cache. Is there anything wrong.
        • 1. Re: IE CACHE PROBLEM NEED HELP ASAP
          nivla17 Level 1
          Anybody? I have all sorts of meta tags in my document specifying cache control and it still caches my flex/swf document.
          • 2. Re: IE CACHE PROBLEM NEED HELP ASAP
            inlineblue Level 1
            The only fool-proof way I've found of doing it is to make the URL to the SWF unique by appending a query string parameter. eg:

            src="MyApp.swf?version=1.1"

            For a Flex HTML wrapper, you have to modify the AC_FL_RunContent call as well by changing the "src" parameter. eg:

            AC_FL_RunContent("src", "MyApp?version=1.1", ...

            • 3. Re: IE CACHE PROBLEM NEED HELP ASAP
              Level 1
              There is a Cache-Control and Pragma parameter in the header of the response to your client's request. I believe if you set the Cache-Control to 'no-store' and 'no-cache' and set the Pragma to 'no-cache', this should stop IE from caching the page. How this is done is different for each application server, so you may have to refer to their documentation on how to get this accomplished.

              --Andy
              • 4. Re: IE CACHE PROBLEM NEED HELP ASAP
                ntsiii Level 3
                Yeah, this is tough. If your web server admin skills are strong, you might be able figure out how to set the headers, but many ouf us just use the querystring parameter method, often appending new Date().toString()

                Tracy
                • 5. Re: IE CACHE PROBLEM NEED HELP ASAP
                  inlineblue Level 1
                  There's also the added complication that cache control headers would (AFAIK) affect only the caching of the HTML wrapper. The browser does a separate fetch to get the SWF, which would result in its own set of headers. How you would control that is more complicated.
                  • 6. Re: IE CACHE PROBLEM NEED HELP ASAP
                    savyasachi
                    inlineblue and Tracy,

                    Came across this post while looking for a solution for the cache problem. I am using Flex 2.0.1.
                    Q1) From what I understood is adding a parameter to the AC_FL_RunContent("src", "MainMod?version1.1",...) call in the HTML wrapper will make sure the latest content is downloaded to the browser. Does this mean when the next time my MainMod.mxml is changed, I need to make this V1.2.

                    Q2) I only saw one occurance of AC_FL_RunContent call in my wrapper where it is referring my SWF file. This is the only place I need to keep changing whenever the mxml file is changed?

                    Q3) Looks like I have to change all Wrapper files (if I have multiple .mxml files in my project). Is there any we can automate this?

                    Do you have a sample that I could take a look at to understand what needs to be changed to fix the issue?

                    Appreciate your help.