4 Replies Latest reply on Jun 22, 2009 4:24 AM by Richard_Abbott

    Removing Swf files from browser's Cache using Mxml code

    Fis Forums Level 1

      Hi,

      Note: Remove swf file from cache of a browser using mxml code,....

       

             I work on J2EE project by using Flex as front end and Java and Oracle as back end.I run my application through IE7 browsers. I am having problem

      on cache.....i.e when i run my swf file and do my changes in mxml code and run my swf file again, the changes made on mxml code does not excuted and old data from cache is fetched and displayed. Can you help me some ideas how to delete a cache of browsers from mxml code.

       

      Please reply me soon

      Thanks in advance for reply....

       

      With Regards

      Gopinath.A

        • 1. Re: Removing Swf files from browser's Cache using Mxml code
          Richard_Abbott Level 3

          Fis Forums,

          yes, caching is always a problem. I do not believe there is any way to delete cached material just from mxml - sounds like that would be a security issue that no plug-in code would be permitted to do.

          The most useful browser for getting round cache problems in my experience is Safari - both versions 3 and 4 have a handy tick option under the Developer menu instructing the browser not to cache items. Even without this, both Firefox and Safari have more finely granulated cache timings than IE, and so identifying changes is easier. It is slightly easier in Firefox to locate the clear cache option than IE, but in both these cases you need to do pretty much the same thing.

          Richard

          • 2. Re: Removing Swf files from browser's Cache using Mxml code
            *Prashant Shelke* Level 4

            Try by putting following snippet in WEB-INF\flex\services-config.xml


            <channels>
                    <channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel">
                        <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint"/>
                        <properties>
                            <add-no-cache-headers>false</add-no-cache-headers>

            • 3. Re: Removing Swf files from browser's Cache using Mxml code
              Rohit Tailor_07

              In the src value of embed tag in HTML just append the date function.

              These will take the swf file from the server every time and not from browser's cache.

               

              just give src value of embed or object tag like the following:

               

              src="flexOutput.swf?"+new Date().getTime().

               

              new Date().getTime() is javascript function which will new time so browser will get swf from server every .

               

              Just try, it is 100% perfect solution.

              If problem exist . Please reply.

               

              Thanks & Regards

              Rohit Tailor

              RIA Developer - Viscus Infotech

              • 4. Re: Removing Swf files from browser's Cache using Mxml code
                Richard_Abbott Level 3

                Rohit,

                I'm not sure this works when you use the JavaScript-based methods of instantiation, eg the AC_FL_RunContent(...) calls, rather than embed tag. Embed is useful in some cases but is not HTML standard according to W3C. Yes, most modern browsers will support it, but there are other drawbacks as well as the standards issue, eg lack of alternate content.

                Richard