Damn you cache!

Caches always seem to be causing trouble, or slowing down development of a website. There are a few things that can help you out :

XML & Flash

Have you ever come across an xml driven flash application that just will not update when you’ve uploaded changes?

Typing in the XML file location and forcing a refresh on that should help you out.

If you want to make 100% certain that these files don’t ever get stuck in a cache somewhere, try adding a random string to the end of the call to these files.

var so = new SWFObject(“/swf/flash_header.swf?xmlFile=flash_header.xml&useSwfLoc=true”, “flash_header”, “100%”, “100%”, “8″, “#FFFFFF”);

becomes

var so = new SWFObject(“/swf/flash_header.swf?xmlFile=flash_header.xml%3Fr=” + Math.random() &useSwfLoc=true”, “flash_header”, “100%”, “100%”, “8″, “#FFFFFF”);

Other pages

You all know about the regular forms of clearing your local cache (CTRL + F5), but what if you’ve got a proxy server between you and your site? These generally won’t work and you’ll be beating your head against a brick wall trying to work it out.

Simply add a question mark and random string after the file name to force a refresh.

Add to Del.cio.us RSS Feed Add to Technorati Favorites Stumble It! Digg It!
    www.sajithmr.com

Leave a Reply