Solved

Internet Explorer cache + Flash SWF

Posted on 2006-11-06
2
4,562 Views
Last Modified: 2013-11-19
Hi there!

I've put a voting system on my webpage. Everything seems to be OK. I've started today with the first poll and people come and vote as expected. The problem arises when someone tries to reload in order to see the latest poll results. In Firefox the latest results are shown all the time, but Internet Explorer seems to cache the swf file and there's no way to reload it! Ctrl+F5 doesn't seem to work either! :-( What can I do? Is there anything I can change on my code to prevent Internet Explorer to cache the SWF file?

The poll is here, just in case you might need to take a look at it:
http://oink.elrellano.com/index.php?l=15421

Thanks!
0
Comment
Question by:pablo_picasso
2 Comments
 
LVL 13

Accepted Solution

by:
AngryBinary earned 125 total points
ID: 17883081
Try adding this to the <HEAD> section of the page on which the SWF resides.

<META HTTP-EQUIV="EXPIRES" CONTENT="0" />

This should indicate to IE that the images and other assorted content on the page expire immediately and should not be cached.

However, it is more likely the case that it's not the SWF being cached, but rather the datasource that the SWF is retrieving, since even though it is being requested by the SWF, it is actually a mechanism of the browser to make the request to the server. If the above META tag doesn't work, this indicates that IE is caching whatever XML file or script you are retrieving to get the latest poll results. A commonly used workaround is to append a query string containing a unique value (like the current time) to the URL in the FLA. Since the query string is never the same, the cached file is never used. For instance, instead of:

myXml.load("./results.xml");

You would use:

myXml.load("./results.xml?" + new Date().getTime().toString());

The same would apply for loadVars, or whatever other actionscript you are using.
0
 

Author Comment

by:pablo_picasso
ID: 17884867
Thanks AngryBinary!! :-)

I've opted for creating a 'reload' button on the SWF which will reobtain the latest poll results :-) This way my visitors won't reload the whole page every time they want to see the results! :-)

Thanks for your great help! Very well explained indeed! :-)

Cheers!
  Picasso.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
I've been asked to discuss some of the UX activities that I'm using with my team. Here I will share some details about how we approach UX projects.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now