[thelist] ie (and netscape?) caching problem for dynamic content

Michael Pemberton mpember at phreaker.net
Sun Nov 18 05:53:01 CST 2001

Here's a few lines of code that use various commands to force as many browsers
as possible to always use the latest version.  Those who use phpMyAdmin will
recognise them : )

    $now = gmdate('D, d M Y H:i:s') . ' GMT';
    header('Expires: ' . $now);
    header('Last-Modified: ' . $now);
    header('Cache-Control: no-store, no-cache, must-revalidate'); // HTTP/1.1
    header('Cache-Control: pre-check=0, post-check=0, max-age=0'); // HTTP/1.1
    header('Pragma: no-cache'); // HTTP/1.0

As with all headers, the standard "Make sure that you don't have any content
already sent" warning applies.

Cameron McCormick wrote:

> I have a problem that ie wants to cache one of my pages with php code in it
> , this code should be rerun each time the page is loaded to do what I want,
> I have found that it will work great when first loading the page, but if you
> follow a link then go back via another link it just loads the cached copy
> from before - is there a tag or something to make it never save the page ?
> thanks for your continued help,
> Cameron

Michael Pemberton
mpember at phreaker.net
ICQ: 12107010

More information about the thelist mailing list