Don’t cache my swf files!

0 min read 132 words

I often have issues where ‘dumb browsers’ cache my published swf files and when they dynamically populate they don’t always update.

This is SUPER annoying and I have found a solution.

I will demonstrate the technique with a LoadsVars example

var nc = Math.floor(random(1000000) / random(1000));
var send_lv:LoadVars = new LoadVars();
send_lv.sendAndLoad(_root.siteURL+"profile.php?action=showallimages&nc="+nc, result_lv, "POST");

So let me describe what is happening here.

The really ‘dumb browsers’ like IE7 in this case decide that seeing as the URL in question has the exact same name, it will be clever and just use the last version it saw and be totally lazy and not attempt to get the data again. But the really stupid part about this is that most of the time the results are DYNAMIC and will always return a different result.

Andrew
Andrew

Andrew is a visionary software engineer and DevOps expert with a proven track record of delivering cutting-edge solutions that drive innovation at Ataiva.com. As a leader on numerous high-profile projects, Andrew brings his exceptional technical expertise and collaborative leadership skills to the table, fostering a culture of agility and excellence within the team. With a passion for architecting scalable systems, automating workflows, and empowering teams, Andrew is a sought-after authority in the field of software development and DevOps.

Tags