dcsimg
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Preventing cache / Forcing Refresh in video streaming?

  1. #1
    Senior Member
    Join Date
    Jul 2001
    Location
    Barcelona
    Posts
    164

    Question Preventing cache / Forcing Refresh in video streaming?

    [Flash 8][AS 1.0]

    Hi there!

    I made a web which contains some video streaming from a flv file.
    The thing is that all the flv file is kept in the browser's cache, and that's a problem, because every time the video file is updated, the browser (Firefox, Opera...) keeps on loading it from the cache.

    Is there any piece of AS (1.0) which prevents it from loading from the cache?
    Or (even better): is there any way to keep it from being kept in any browser's cache folder?

    I used a slightly modified version of this code (skipCache.as), but it won't work:
    PHP Code:
    /*
    **************************************************************
    * Developed by R.Arul Kumaran [arul@shockwave-india.com]     *
    * for more code keep visiting [[url]www.shockwave-india.com/blog][/url] *
    **************************************************************
    version 1.1 Last updated on 9, Jan 2004
    */
    /*
    | Useful when you don't want your server files to be cached by both server and browser
    |
    |   getSkipCacheString() - Return a blank string("") when the swf is running as a local file and
    |                          returns a random string like "?CacheBuster=0.0308893630281091&timestamp=1073037565155"
    |                          when the swf is from a web server
    |
    */
    _global.getSkipCacheString = function() {
            if (
    getSkipCacheString.isLocalPlayback) {
                    return 
    "";
            }
            
    dStr "&timestamp="+new Date().getTime();
            return 
    "?CacheBuster="+Math.random()+dStr;
    };
    getSkipCacheString.isLocalPlayback _url.indexOf("file") == 0;
    /*
    //sample usage
    #include "skipCache.as"
    my_xml = new XML();
    my_xml.onData = function(dta) {
    trace(dta);
    };
    my_xml.load("myfile.xml"+getSkipCacheString());
    */ 
    Thanks in advance for your help.
    Cheers,
    Last edited by Manare; 09-21-2009 at 12:11 PM.

  2. #2
    AS3 Mod
    Join Date
    Sep 2007
    Location
    O-H-I-O
    Posts
    2,385
    What code are you using to load the FLV? That's where you will need to add the "cache buster" script.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center