in reply to Re: Automatic page refresh
in thread Automatic page refresh

You shouldn't set the expires header to be "now" (update (thanks frodo72): but that code doesn't set the header to be "now", it is converted to an actual date. That's teach me to not test - you only ever get something wrong if you don't test, 99% of the time, if you do test, your test will give the expected result). The spec says that it must be in HTTP-Date format. It does also say that if a client recieves anything that isn't HTTP-Date, then it should treat it as "already expired" - but intentionally triggering error recovery isn't a fantastic idea.

Other caching headers might also come in useful. Caching Tutorial for Web Authors and Webmasters is a worthwhile read.

Replies are listed 'Best First'.
Re^3: Automatic page refresh
by polettix (Vicar) on Jul 28, 2005 at 13:14 UTC
    But the respondent is suggesting to set the -expire parameter of the header function to now, which is pretty different. From CGI docs:
    Most browsers will not cache the output from CGI scripts. Every time the browser reloads the page, the script is invoked anew. You can change this behavior with the -expires parameter. When you specify an absolute or relative expiration interval with this parameter, some browsers and proxy servers will cache the script's output until the indicated expiration date. The following forms are all valid for the -expires field:
    +30s 30 seconds from now +10m ten minutes from now +1h one hour from now -1d yesterday (i.e. "ASAP!") now immediately +3M in three months +10y in ten years time Thursday, 25-Apr-1999 00:40:33 GMT at the indicated time & da +te

    Flavio
    perl -ple'$_=reverse' <<<ti.xittelop@oivalf

    Don't fool yourself.