;

PDA

Click to See Complete Forum and Search --> : .swf's not refreshing in browser


Bob Godwin
06-24-2003, 02:37 PM
I've been having a problem with my web site lately. I run a band site that gets updated at lest once a week. Lately, it's been taking several days for the .swf's to refresh. Not good when you have updates on Sunday that don't show up till Wednesday when you have a gig on Tuesday! I put a CD review from the London Times on the site Suturday morning and it still hasn't showed up. I've deleted everything in all the temp folders (Internet, Windows, etc.) that I could find, but no luck, the old files are still there. I'm not the only one that this happens to (I've talked to others that have the same problem with my site). Anyone have any ideas why this is happening?

Bob Godwin
http://harmonicashah.com

necromanthus
06-24-2003, 04:04 PM
This is not your fault.
A lot of hosts (servers) have "doubled" folders:
- the first one for uploading files
- the second one for access (here's what visitors can see).
The refresh time may vary from few hours to few days (!?!).
You have to live with that (or you can chage the host).
cheers

gusmus
06-24-2003, 05:17 PM
I think it may be an idea to check if your IP has recently installed a transparent proxy server, it's all the rage these days. If they have then it can take up to 72 hours to refresh your page. What you see in your browser is not what is actually on your server,, it's a copy, (more loading speed and less work for the IP) in other words, a rip off to the paying customer. I have a bit of html saved somewhere which will over ride the proxy refresh rate, I'll post it later when I find it. Cheers
Try pressing CTRL while you click Refresh, that will force a refresh from the server and works 100% with html, it doesn't always work with flash and java content.

gusmus
06-25-2003, 04:54 AM
As promised.
There are two ways around this problem and I'm afraid that none have a surefire success rate.Remember that you only need to use this on pages with flash content, you can force an html refresh by holding down CTRL (SHIFT on Netscape) and clicking REFRESH.You can also have a go at tricking the proxy cache if you need to see the changes to a page instantly. Instead of just typing in your url, type it like this http://www.mypage.com?ww1 anything after the question mark sometimes tricks the proxy into thinking that you are looking for a page that doesn't exist in its cache so it loads the page directly from your server, just change the letters or numbers after the question mark each time you want to view your page.

The next method is a little bit complicated but not too hard.
Create a file in notepad called htaccess.txt and in this file put

ExpiresActive On
ExpiresByType image/gif A2592000
ExpiresByType image/swf A2592000
ExpiresByType image/jpg A2592000
ExpiresByType image/jpeg A2592000
ExpiresByType text/html A86400

(note that the numbers denote seconds so A2592000 is actually 1 month and A86400 signifies 1 day) These values can be changed to whatever you want IE: (A10 signifies that it expires in 10 seconds time)you can put A0 if you wish.
This file now has to be loaded into the directory on your server where you store your images and swf.s AND (very important) to have its name changed to " .htaccess " (remember to save a copy as "htaccess.txt" before you change the name), you can do this with your ftp program, just before you load it to your server select "change name" to .htaccess . Depending on your server configuration, this should work for most proxy caches but I'm afraid that some don't support it.

This method is quite simple but again it depends on how the proxy cache reads your page. If it simply reads the HTTP header then this won't work, if it reads your HTML headers then it works fine,

<HTML>
<HEAD>
<TITLE>---</TITLE>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">

all the other header info

</HEAD>
<BODY>

All the rest of your page stuff

</BODY>
<HEAD>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
</HEAD>
</HTML>

you can also try changing the "expires meta to
<META HTTP-EQUIV="expires" CONTENT="Wed, 26 Feb 1997 08:21:57 GMT">
as some servers won't recognise the -1 value and ask for a specific date and time. Just make sure you put an old date.
It can't hurt to use both methods but make sure that you use equivalant expiry values.

That's about it, this stuff works (most times) on "Apache / Unix" servers so it may not work for you if you have a different type of server. Good Luck, if it doesn't work then dump it all and live with the proxy cache, or as Necromanthus suggested,,, Change your ISP (host). Cheers

Bob Godwin
06-27-2003, 03:57 PM
Thanks. The CTRL/REFRESH didn't do it, and I'm yet to try the other methods. What I did was change the name of the .swf's that are time sensitve, and that seems to have done the trick.

docree
06-27-2003, 11:04 PM
You could use a script that shows a dif page for each day of the week and just update the page it uses for the day.
Or... try another less convoluted method.
Doc

OwenAus
06-29-2003, 06:36 PM
This almost always cures it:

"swfname.swf?val=YYYYMMDDHHMMSS"
eg
"swfname.swf?val=20031202123742"

used whereever the swf is referenced in the html.

bridelh
06-30-2003, 03:26 AM
Hi Owen!
Where u bean....

Hilary

--

OwenAus
06-30-2003, 04:50 AM
Flat out earning an extra quid.

How you doing?

mojito
11-11-2005, 08:27 AM
This almost always cures it:

"swfname.swf?val=YYYYMMDDHHMMSS"
eg
"swfname.swf?val=20031202123742"

used whereever the swf is referenced in the html.

I have used the random function before in asp to force the query string to be different each time, isnt your method going to work just once then the cache will look to see if the filename is the same, in yours it will be so will retreive the cached version?

please lets expand on this one as i'm having issues with my flash being embeded via javascript.
m