andrewpthorp
andrewpthorp

Reputation: 5106

How to handle manual .swf caching?

I have a .swf in my rails application, located here:

/public/bin/editor/Editor.swf

It works fine, with one flaw, it gets cached often, so when we release a new version we are usually needing to tell the customers to clear their cache when they experience issues. My question is, how could I force the .swf to break cache when I release a new version? Something like:

/public/bin/editor/Editor.swf?timestamp=124158512132

I tried the above, but it did not seem to work. Any ideas would be great!

Upvotes: 1

Views: 1309

Answers (2)

Jevgenij Dmitrijev
Jevgenij Dmitrijev

Reputation: 2238

if you are using swfobject.js and want the item not be cached you need to add this, to the swf description:

swfobject.embedSWF( 'index.swf ?'+ new Date().getTime()...

of course you can change getTime() to the format you like.

Upvotes: 1

Nate
Nate

Reputation: 2936

Consider employing a versioning nomenclature to your editor. For example Editor_v1.01.005.swf

Here's a good format

app_major_minor_patch.swf

There are a number of benefits for doing this, and it will also solve your caching issue as well out of coincidence. :)

Upvotes: 0

Related Questions