6 Replies Latest reply on Dec 14, 2006 6:48 AM by BaileyBurger

    IE Cache Problem

    upshotvideo Level 1
      Has anyone found or developed a good way to prevent IE from caching a flex APP? In my application, when a user changes a value, the new value doesnt show up when the app is refreshed unless you clear the cache. Its even being displayed from an PHP/XML file created from a DB. Even though the service is called over again, somehow flex still displays old values. Firefox is fine. Annoying.
        • 1. Re: IE Cache Problem
          ntsiii Level 3
          Are you talking aboput the Flex app itself, or the result of a dataservice call?

          You can try appending some always-different parameter value to the url. Some folks use Date, some use a random number.

          You can also control caching in the browser by Tools, Options, Settings, Every Visit to the page

          • 2. Re: IE Cache Problem
            upshotvideo Level 1
            Yeah i tried the querystring trick but it just doesnt seem to work. When a user changes a rank to one of his properties in the app, the db updates fine, but some reason when i refresh the app, it goes back to the old value. I cant imagine why it would do that when its calling the service over again, it should just get the new results. I don't even know how its caching that. I clear the cache in IE and it then displays the new value. Its strange, and I dont want to have to tell all the clients using the tool that they have to clear their cache everytime, or even change a setting for that matter.
            Thanks for the reply
            • 3. Re: IE Cache Problem
              ntsiii Level 3
              Hmm, the querystring trick almost always works. I would not give up on that yet.

              Do you have control of the server? Can you set the headers of the response? I don't recall the syntax, but seem to recall seeing it here sometimes back.

              • 4. Re: IE Cache Problem
                chris.huston.t10 Level 3
                I put the following at the top of my PHP file
                header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
                header('Cache-Control: no-store, no-cache, must-revalidate');
                header('Cache-Control: post-check=0, pre-check=0', FALSE);
                header('Pragma: no-cache');
                Database query...

                This seems to work for me to stop the IE caching problem. I haven't tried this with an XML file, but it might work. My PHP script returns XML formatted data.

                • 5. Re: IE Cache Problem
                  upshotvideo Level 1
                  Thank you so much. It works perfectly.
                  • 6. Re: IE Cache Problem
                    BaileyBurger Level 1
                    Does anyone know of a cold fusion version of the code posted by Masamune?