A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: .swf's not refreshing in browser

  1. #1
    Junior Member
    Join Date
    Feb 2003
    Location
    Michigan
    Posts
    19

    .swf's not refreshing in browser

    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

  2. #2
    undead creature necromanthus's Avatar
    Join Date
    Feb 2002
    Location
    ROM
    Posts
    1,890
    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

  3. #3
    Can't Re- Member gusmus's Avatar
    Join Date
    Sep 2002
    Location
    España
    Posts
    663
    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.
    Last edited by gusmus; 06-25-2003 at 02:15 AM.
    humanus somes est divinitus in ipsum
    Wiliiam Wallace

  4. #4
    Can't Re- Member gusmus's Avatar
    Join Date
    Sep 2002
    Location
    España
    Posts
    663
    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
    Last edited by gusmus; 06-25-2003 at 04:55 AM.
    humanus somes est divinitus in ipsum
    Wiliiam Wallace

  5. #5
    Junior Member
    Join Date
    Feb 2003
    Location
    Michigan
    Posts
    19
    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.

  6. #6
    Degenerate and baise art thou. docree's Avatar
    Join Date
    Feb 2001
    Location
    USA
    Posts
    390
    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

  7. #7
    Senior Member
    Join Date
    Jun 2001
    Posts
    289
    This almost always cures it:

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

    used whereever the swf is referenced in the html.

  8. #8
    Senior Member
    Join Date
    Sep 2001
    Location
    Australia
    Posts
    379
    Hi Owen!
    Where u bean....

    Hilary

    --

  9. #9
    Senior Member
    Join Date
    Jun 2001
    Posts
    289
    Flat out earning an extra quid.

    How you doing?

  10. #10
    Senior Member
    Join Date
    Aug 2004
    Location
    London
    Posts
    211

    surely this needs to be server dynamic?

    Quote Originally Posted by OwenAus
    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
    ----------------------------
    A travel blog

    Landed At
    ----------------------------

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center