Quick (hopefully) Webby Question

MausMaus Join Date: 2002-11-03 Member: 5599Members
<div class="IPBDescription">re: caching and site updates</div> I just put together a quick photo blog type site, to encourage me to use my camera more often, and the way I have it working is basically that I update the index every time I put a new photo up, then archive older pictures (e.g. may22.html). The problem is that for some reason when I update the index then visit the page to test it, it shows me what is cached instead of the new index.

Is that a browser flaw, or can I set up my page/site such that each time the index is updated browsers will download the new one?

Comments

  • DOOManiacDOOManiac Worst. Critic. Ever. Join Date: 2002-04-17 Member: 462Members, NS1 Playtester
    edited May 2005
    If the site is dynamically generated (via PHP, JSP, ASP, etc) then you need a little help from your special friend HTTP Header. Specifically:

    <!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->// HTTP/1.1
    header("Cache-Control: no-store, no-cache, must-revalidate");
    header("Cache-Control: post-check=0, pre-check=0", false);

    // HTTP/1.0
    header("Pragma: no-cache");<!--c2--></td></tr></table><div class='postcolor'><!--ec2-->

    If you have no idea what this means and/or you are using a static site (i.e. hardcoded HTML pages), then:
    a) If you use IE, go to Tools->Internet Options->Settings button and click the radio button that says 'Every visit to the page'
    b) If you use Firefox, there is no similar option (that I know of), so just hold shift and click refresh.

    [edit]
    From my own experience, you may be able to get by with just <!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->header("Cache-Control: no-cache");<!--c2--></td></tr></table><div class='postcolor'><!--ec2-->[/edit]
  • BlackMageBlackMage [citation needed] Join Date: 2003-06-18 Member: 17474Members, Constellation
    or just hold shift while pressing f5
  • im_lostim_lost TWG Rule Guru Join Date: 2003-04-26 Member: 15861Members
    <!--QuoteBegin-DOOManiac+May 24 2005, 04:04 PM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (DOOManiac @ May 24 2005, 04:04 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->If you have no idea what this means and/or you are using a static site (i.e. hardcoded HTML pages), then:
    a) If you use IE, go to Tools->Internet Options->Settings button and click the radio button that says 'Every visit to the page'
    b) If you use Firefox, there is no similar option (that I know of), so just hold shift and click refresh.<!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd-->
    It sounds like he is using a static site. He isn't worried about his own viewing, he wants to change how the site works for the people visiting it. Here's something I found from a google search:

    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="expires" content="0">

    The person posting it claimed that it works in IE and Firefox, and it will work for static pages.
  • MausMaus Join Date: 2002-11-03 Member: 5599Members
    Yep, it's just a static page for now, though I'll make something fancier when I get the time to. I'll give that a try, im lost, thanks. <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html/emoticons/smile-fix.gif' border='0' style='vertical-align:middle' alt='smile-fix.gif' /><!--endemo-->
Sign In or Register to comment.