Prevent Caching of Flex Apps In Domino
Browsers are really good at caching .SWF files. This can be a good or a bad thing. It's a good things until it happens that your customer is looking at the old version and not the one you've just fixed and the confusion then ensues.
What you need to do is make sure that when you upload a new SWF file that's what everybody sees. Here's a quick and easy way to do it.
The image below shows the File Resources section for the Staff Skills database that I've been talking about recently. Notice the multiple versions of the same SWF.
Each time I recompile the app in Flex Builder I add a new File Resource and add a new version number to it.
Then, in the Form it lives in I update the value in a Computed For Display Field, called "FlexAppVersion", like below.
This field is referenced directly in the two Computed Values you see above. Should all make sense. Rocket science it ain't.
Next time a user refreshes the page you're almost guaranteed they'll be getting the new version. Although there's always the chance their browser has cached the HTML itself. To check for this you can reference the version field in the page title as well, like below.
If what you expect people to see isn't what they say they're seeing then you can always ask them what they see in the title just to be sure!
Nice tip! Thanks again.
Why don't you leverage HTTP Cache directive ? Don't browser obey them when it's a swf file ?
Jake,
It is not rocket science, but I think this definitely is the best way to leverage caching whilst also forcing a fresh copy at times. Sites like Flickr do the exact same thing for their CSS file. They set the expiration date to many years ahead and include a version number in the filename like you do to force a fresh download when there is a new release.
The only difference is that on most platforms you have automatic builds, so that a unique build number is automatically included and there are no manual actions to take. "Building" software for a release is quite a foreign concept in Domino apps, but all too common in .NET, Java and even scripting languages.