2 Replies Latest reply on May 23, 2007 3:12 PM by kglad

    Actionscript 3.0 and caching

    hciguy Level 1
      Hi,

      I know in previous versions of the Flash Player and AS there was a problem any time you used an external script, in say Perl or PHP, to connect to a database and bring information into your SWF in a browser. There was a caching issue that made the data not also refresh or something in the SWF. Is this problem still around? If I developed a website using Flash, PHP and mySQL and I load in data from mySQL, is there going to be a cache problem with it?

      Hoepfully someone is familiar with that former problem because I know I'm not explaining it well...but I know it was why people wouldn't tie a database into a browser-based SWF...

      Thanks in advance.
        • 1. Re: Actionscript 3.0 and caching
          BuffDogg
          hciguy,

          This is a problem I ran into when building a website that used a flash front end to talk to a database. I used ASP and not PHP to handle the communication but the same problem arises. When using ASP the solution is easy. You simply add the following lines of code to your asp page that returns the data to flash.

          Response.CacheControl = "no-cache"
          Response.AddHeader "Pragma", "no-cache"
          Response.Expires = -1

          I don't have a PHP example of how to accomplish the same thing but I'm sure you could find an equivalent script.
          • 2. Re: Actionscript 3.0 and caching
            kglad Adobe Community Professional & MVP
            append a variable with changing values to your php, perl etc name to prevent data retrieval from a cached file.