5 Replies Latest reply on Mar 21, 2008 8:49 AM by Newsgroup_User

    force download video in stead of using the cache ?

    chrisatflash Level 1
      Hello,
      Does anyone has expierence with the fact that when you connect to an flv file to play video in flash
      the first time it will download the flv file. But suppose i change the content of the flv file but keep the name the same it will play the previous video because it's using the cache of IExplorer.

      Is there a way to force the download? Or a way when the movie is finished to clear that cached movie?
      I also tried to unload the movie, but that doesn't do the trick.

      If someone has a fix for this, please let me know.

        • 1. Re: force download video in stead of using the cache ?
          Level 7
          Hello Michealnl,

          > Hello,
          > Does anyone has expierence with the fact that when you connect to an
          > flv file
          > to play video in flash
          > the first time it will download the flv file. But suppose i change
          > the content
          > of the flv file but keep the name the same it will play the previous
          > video
          > because it's using the cache of IExplorer.
          >
          > Is there a way to force the download? Or a way when the movie is
          > finished to
          > clear that cached movie?
          > I also tried to unload the movie, but that doesn't do the trick.
          > If someone has a fix for this, please let me know.


          try an old trick - add some hash to your file URL. smth. like this:

          "/movies/movie.flv?FewDa53D2SD"

          With a new hash added each time you request url the later will be enterpreted
          as a unique one and will be downloaded again regardless browser cache.

          P.S. : I guess it's not a problem to code hash generator?


          • 2. Re: force download video in stead of using the cache ?
            Level 7
            You don't need anything more than a simple getTimer() for your cache buster.

            "/movies/movie.flv?r=" + getTimer();

            --
            Dave -
            Head Developer
            http://www.blurredistinction.com
            Adobe Community Expert
            http://www.adobe.com/communities/experts/


            • 3. Re: force download video in stead of using the cache ?
              chrisatflash Level 1
              Thanks! That did the trick!
              • 4. Re: force download video in stead of using the cache ?
                Michael Trout Level 1
                I am still very new action scripting, so please bear with me when I ask newbie questions.

                Dave, would that also apply to loading other files, such as text?
                My current action reads thus:

                loadVariablesNum("news.txt", 0);
                stop();

                As with the OP, this is loaded into the cache and isn't always updated when the visitor returns to the site.

                Would this be an appropriate revision to the code?

                loadVariablesNum("news.txt?r=", 0) + getTimer();
                stop();
                • 5. Re: force download video in stead of using the cache ?
                  Level 7
                  Hello Michael,

                  > I am still very new action scripting, so please bear with me when I
                  > ask newbie questions.
                  >
                  > Dave, would that also apply to loading other files, such as text?
                  > My current action reads thus:
                  > loadVariablesNum("news.txt", 0);
                  > stop();
                  > As with the OP, this is loaded into the cache and isn't always
                  > updated when the visitor returns to the site.
                  >
                  > Would this be an appropriate revision to the code?
                  >
                  > loadVariablesNum("news.txt?r=", 0) + getTimer();
                  > stop();


                  loadVariablesNum("news.txt?r="+ getTimer(), 0) ;
                  stop();



                  btw. it's absolutely unnecessary to add hash as a parameter. you can just
                  ad it right after "?" symbol.
                  Hash purpose is to make your URL unique to browser. Also, if you *** this
                  hash as a parameter in a URL-encoded string - you pass this parameter to
                  flash (if dealing with links to flash files) and it's OK if you use it further,
                  but do you need additional garbage if not? )