2

I have a page that contains a flash object. The flash file is wrong I a change was made to one of the images specified. I have a big problem, users who have already hit the site, seem to have this flash object cached. I have tried renaming it, have put in <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">, but no matter what I do, it still seems to recognize the cached flash object as being the object to display. Try it in a new browser and it works fine. Now I know I can clear the cache to get it work but I can't expect to tell every user this. Any ideas as to what else I can try?

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540001"
        codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0"
        width="1127" height="333" id="lottery6" align="middle">
    <param name="allowScriptAccess" value="sameDomain" />
    <param name="allowFullScreen" value="false" />
    <param name="wmode"  value="transparent" />
    <param name="movie"
           value="flashtemp/lottery1.swf?logo=<%=WinnerSponsorImage%>&winningNumber=<%=Winner%>&link=<%=WinnerSponsorLink%>&sponsorName=<%=WinnerSponsorName%>&winnerName=<%=WinnerName%>&hourToPlay=<%=PrizeDrawHr%>&minToPlay=<%=PrizeDrawMin%>" />
    <param name="quality" value="high" />
    <param name="bgcolor" value="#5d8804" />
    <embed wmode="transparent" quality="high" bgcolor="#5d8804"
           width="1127" height="333"
           name="lottery6" align="middle"
           allowScriptAccess="sameDomain" allowFullScreen="false"
           type="application/x-shockwave-flash"
           pluginspage="http://www.adobe.com/go/getflashplayer"
          src="flashtemp/lottery1.swf?logo=<%=WinnerSponsorImage%>&winningNumber=<%=Winner%>&link=<%=WinnerSponsorLink%>&sponsorName=<%=WinnerSponsorName%>&winnerName=<%=WinnerName%>&hourToPlay=<%=PrizeDrawHr%>&minToPlay=<%=PrizeDrawMin%>"  />
</object>
vyegorov
  • 21,787
  • 7
  • 59
  • 73
user1367729
  • 33
  • 2
  • 6

1 Answers1

2

It sounds like the browser is caching the index page. Try adding the following meta tags in the <head> section of your html.

<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="expires" content="-1">

If you're running Apache you can set the cache-related response headers in .htaccess (assuming .htaccess override is enabled in Apache's config). Example use of .htaccess...

<FilesMatch "^index\.html$">
Header set Cache-Control: "no-cache, must-revalidate"
</FilesMatch>

More on this - http://www.askapache.com/htaccess/apache-speed-cache-control.html

Edit: If you're running IIS you can set the cache control headers by following the instructions here - Add Expires or Cache Control Header to static content in IIS

Community
  • 1
  • 1
John Himmelman
  • 21,504
  • 22
  • 65
  • 80
  • Apologies, I should of mentioned that I am running .net. I've put the meta tags in but it still appears to be loading the flash object from cache. Which has baffled me! – user1367729 May 11 '12 at 16:02
  • @user1367729 are you running IIS? If so, you can set the cache-control headers for the swf and html file by... http://stackoverflow.com/questions/865252/add-expires-or-cache-control-header-to-static-content-in-iis – John Himmelman May 11 '12 at 16:31
  • will that stop the cookie from caching? – Nilesh patel Feb 08 '13 at 12:36