dcsimg
A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: xml documents and the internet cache

  1. #1
    Senior Member
    Join Date
    Nov 2004
    Location
    Toronto, Canada
    Posts
    194

    xml documents and the internet cache

    is there a command to check to see if an xml document has been updated since it was last called? firefox doesnt seem to check automatically.

    just wondering to clarify before i submit it as a bug to firefox

  2. #2
    Senior Member tupps's Avatar
    Join Date
    Jan 2001
    Location
    Melbourne
    Posts
    2,035
    It might not be firefox but the proxies along the way. Typically if the URL is in the cache, then it will be loaded unless you have specified a expire period (something done on the server).

    Typically the best way to avoid this is to add a random number to the end of the url (you make it look as though it is part of the query string) and this will force the browser and proxies to always get a new documnet. The best random number is the datetime as you won't have different people getting the same document (in the case of proxies).

    Thanks

    Luke
    Flash-XML FAQ
    http://www.tupps.com/flash/faq/

  3. #3
    Senior Member
    Join Date
    Nov 2004
    Location
    Toronto, Canada
    Posts
    194
    would it be possible for you to show me how to add the number because im not sure i fully understand how i would do that and still call the file

  4. #4
    pablo cruisin' hanratty21's Avatar
    Join Date
    Mar 2002
    Location
    on the lam
    Posts
    2,275
    "Why does it hurt when I pee?" -- F. Zappa |

  5. #5
    Mod cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    This code is an example to bypass any cache in the browser:

    var xmlfile:String = "file.xml";
    //this is to bypass the xml cache
    if (System.capabilities.playerType != "External" && System.capabilities.playerType != "Standalone") {
    xmlfile+= "?"+new Date().getTime()+Math.floor(Math.random()*10000);
    }
    myXML.load(xmlfile);

    This has the advantage that you can work on your harddrive without calling the xml file with the number which would give you an error.
    - The right of the People to create Flash movies shall not be infringed. -
    | www.Flashscript.biz | Flashscript Biz Classes/Components |

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