5 Replies Latest reply on Mar 12, 2013 5:06 PM by Ed@SF

    flash and cache

    zibber

      Hi wonered if someone could help me wih this one.

       

      Currently making a facebook game all in flash, it uses multiple swfs to make up the game and its elements for optimisation.

       

      My question really is down to flash cache issue so we can make updates to various swfs that are going to be, site wide for users so the game doesnt break. Currently some users get older versions which breaks things if other swfs have chnaged how they communicate as an example.

       

      I am aware of adding a query string onto the end to force to get the latest version.....however doesnt this make the use of a cache redudant as its being simply overriden? Would jsut like it to work as it should:) If theres a new version of a swf use it..if not use current one.

       

      Just wondered what the best solution was for this these days

       

      thx in advance

       

      ade

        • 1. Re: flash and cache
          Ned Murphy Adobe Community Professional & MVP

          If you want to be sure that the latest files are being used, use the query string approach.  You have no control over how users set their browser in terms of whether they always check for new versions of files or not.

          1 person found this helpful
          • 2. Re: flash and cache
            zibber Level 1

            thanks for response Ned.

             

            So if i incremenent the query string value for each release:

             

            v=1

            v=2

            ...

            ...

             

             

             

            this would solve the caching problem? plus if still on v1 it would use the same files already cached?

             

            regards

             

            ade

            • 3. Re: flash and cache
              Ned Murphy Adobe Community Professional & MVP

              Hopefully I'm not misleading you... I may have misunderstood the scenario, but when I want to insure a file is pulled from the server I append a random value (using a randomizing function).  So if I were loading the file into a main swf I would append "?v="+Math.random();    If this suits your scenario then it saves you from having to update anything when a new version is released

              1 person found this helpful
              • 4. Re: flash and cache
                zibber Level 1

                thanks Ned

                 

                the random method is ok and would work but "ideally" i dont want the user having to load a new version UNLESS we have done another release for efficiency purposes.

                 

                so for now i have implemented my version num approach. so the hub movie loads a version number in from flash vars and then uses that to load other swfs. I havent tested it yet but hopefully this will work as i expect. Namely only pull new version down if the versionNumber has changed.

                • 5. Re: flash and cache
                  Ed@SF Level 1

                  Not an answer, am bumping this thread...

                   

                  The original question encompasses things very clearly, so this "bump" is to check for the actual/more efficient solution (if any). Maybe a "cache control" object/class in the making? At the very least, this (hopefully) makes things a bit more efficient than it currently is...(for .net folk, this would be something akin to cacheability/duration = x). As it is, its either "cache or don't cache everything".....

                   

                  This issue extends to other loaded objects, even XML, and if I'm not mistaken the "solution" is still the same - appending some random querystring value to "fool" the player into thinking its loading a new XML file all the time.....

                   

                  Thanks....