With web technologies generally, and flash specifically, managing cached assets can sometimes feel like walking a tightrope. If you’ve got a simple slideshow and have occasional updates to the image you want immediately reflected to the client, you’ll often see traditional “cache-busting” methods like appending a random number of the current UTC time to the end of an image.

This has always felt a little heavy-handed to me (imagine a slideshow with 25 images, with a couple hundred page views per day – that’s a lot of downloads and a lot of files cached unnecessarily on the client).

A little trick I use to “nudge” caching is to add the UTC time to the swf’s FlashVars (or preferably, just as a query string variable to the swiff’s path) at the time of any update:

Then when loading assets with ActionScript, append that value to the image filename…

var url:String = "path/to/your/image.jpg?" + root.loaderInfo.parameters.updated;

This way, whenever an update is made, we guarantee a fresh copy, but those files will still cache normally between updates.