Preventing The Browser From Returning A Cached SWF
A quick little snippet using Coldfusion to avoid swf caching at the browser. Swf caching can be a real pain in the but during the development and it can also be annoying in production. When you make updates, you actually want to view them. Anyway, enough chit chat:
swfobject.embedSWF('myFlashApplication.swf?nocache=#CreateUUID()#', 'myDiv', '600', '480', '9.0.0', 'expressInstall.swf',{},{});
So the above snippet, using swfobject because it does the trick so nicely, shows that we are throwing a url parameter at the swf to be injects. Essentially, this does nothing at all. However, the Coldfusion CreateUUID() function will give us an easy-to-generate unique number every time and the unique param. The browser sees a unique url and will grab the swf anew each time.


I don't make important changes to an app without re-initializing it so this makes sure that 95% of the time people are getting a cached version and only forced to do a re-download if I've made changes.
I think I am still inclined for the CreateUUID(), though I guess I ought to consider how much it taxes the server, but, as I muse over the appKey, there might be situations where it gives you a nice handle for auditing behavior.
Anyway, thanks for the comment.