#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2011
    Posts
    13
    Rep Power
    0

    Flash caching with a twist (static flv load in swf)


    Hi all,

    Here's the situation
    I have an swf but not the fla file but i know that this file loads static flvs inside it.
    Now we all know the problem with flash caching. I have used the following methods to fix this problem but even though i change the flvs content their cached versions appear instead of the updated ones.

    Here's what i tried:

    1. Adding a random number at the end of the swf file path.

    2. Adding the meta tag pragma no-cache to my page.

    and finally and most importantly
    3. Changing the name of the swf dynamically each time an updated flv is added to it.

    None of these methods worked.

    So my questions are:
    When an swf file loads another file into itself does it act as a container and do those files get fetched and saved inside the browsers cache?

    Meaning if the filename of the flv is the same will it be fetched again or will the cached version be used instead?
  2. #2
  3. No Profile Picture
    Gotta get to the next screen..
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2003
    Location
    Legion of Dynamic Discord
    Posts
    6,675
    Rep Power
    3164
    It will be cached. You can see this for yourself by clearing your browser cache, then visiting the site and looking at what files have been downloaded. In IE9 you can do this by clicking the cog image in the top right corner, then choose Internet Options. On the General tab click the Settings button under the "Browsing history" section. Now click "View Files" on that popup. It will take you to your cache directory.

    Adding a random number to the end of the SWF path won't help, you have to add it to the FLV path. Adding it to the SWF file will make it re-download the SWF but not the FLV. This is the same for changing the SWF filename. It will re-download the SWF but not the FLV. I wouldn't use a random number, I always use the current date time value now:

    var request:URLRequest = new URLRequest("http://www.example.com?nocache=" + (new Date().getTime()));

    I don't think the Flash plugin understands the no-cache meta tag for internally loaded content. You can see someone has tested that here.

    Comments on this post

    • Abnaxus78 agrees
    Quis custodiet ipsos custodes?
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2011
    Posts
    13
    Rep Power
    0
    @Tann San thanks for the reply. that was the last thing we thought might be causing the issue. meaning the flv are getting cached.

    Someone told us there is a setting on the IIS so that some files won't be cached on a particular site. We will try that first since we can't use the flv renaming solution cause we do have access to the flvs but not the fla the swf was created.

    Thanks again
  6. #4
  7. No Profile Picture
    Gotta get to the next screen..
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2003
    Location
    Legion of Dynamic Discord
    Posts
    6,675
    Rep Power
    3164
    There is a free built in FLV player in the Flash IDE. You can drag and drop an instance of that to the stage and tinker with its appearance. Maybe you could use that instead of the one you are currently using.
    Quis custodiet ipsos custodes?

IMN logo majestic logo threadwatch logo seochat tools logo