Solved

Internet Explorer cache + Flash SWF

Posted on 2006-11-06
2
4,566 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An enjoyable and seamless user experience can go a long way on an eCommerce site. While a cohesive layout and engaging copy play roles in creating a positive user experience, some sites neglect aspects that seem marginal but in actuality prove very …
There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
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…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

803 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