SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast scottyc's Avatar
    Join Date
    Feb 2005
    Location
    Salford, Manchester, UK
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Latest version of site - cache problem

    I'm probably going to sound pretty dumb, but here goes:

    I have been updating the school website quite a lot recently. My problem is:

    When anyone goes and looks at it (my Boss for instance) - he says I haven't changed anything. Of course, I have, its just that he is seeing the cached version on his hard drive. He can clear it (F5) and he then gets the latest version but he wants visitors to get the latest version without having to do this.

    (Like news sites - you always get the latest there, no 3 day old cached pages every time you visit)

    Please help

    thanks

    Scottyc

  2. #2
    SitePoint Wizard DougBTX's Avatar
    Join Date
    Nov 2001
    Location
    Bath, UK
    Posts
    2,498
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could try adding the no-cache meta tag: http://www.i18nguy.com/markup/metatags.html

    Or if you are able to yuse PHP, you could try sending no-cache headers that way: http://www.php.net/header

    PHP Code:
    <?php
    // Date in the past
    header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");

    // always modified
    header("Last-Modified: " gmdate("D, d M Y H:i:s") . " GMT");
     
    // 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");
    ?>
    Douglas
    Hello World

  3. #3
    SitePoint Enthusiast scottyc's Avatar
    Join Date
    Feb 2005
    Location
    Salford, Manchester, UK
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Douglas

    I've been away so haven't tried your suggestion yet. Will try it this week and let you know how I get on

    Cheers

  4. #4
    SitePoint Evangelist sputza's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    528
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I had the same problem once before. To solve the problem, I deleted all the files from the ftp server and then uploaded them again. I never had the problem again.

    I have no idea as to how it worked or why it did what it did... but it worked ever since.

    Just my $0.02
    Steven Watkins
    Chief Web Ninja
    Code Monkey Interactive
    lowgravity.ca


Bookmarks

Posting Permissions

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