Swf caching in Internet Explorer
We had an issue the other day where a swf was being cached in Internet Explorer – the first time the page loaded it rendered fine, but if you refreshed the browser, a set of lines appeared on the swf. It could be fixed by clearing the cache, but we needed an easier way to do it.
The following technique is using swfobject to embed the swf on the page. It simply adds a querystring to the end of the URL of the swf that changes by time, to force the browser to download a new version of the file, fixing the caching issue.
swfobject.embedSWF('swf/test.swf?nocache=' + (new Date()).getTime(),
, 'testFlash'
, '100%'
, '100%'
, '9.0.0'
, false
, {}
, {}
, {});
The URL of the swf will then be generated as something like swf/test.swf?nocache=1241984085446, which the browser will treat as a new URL, so will re-download the file.
-
Calendar
May 2013 M T W T F S S « Jul 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 -
Meta





