Re: [PHP-GENERAL] New header function behaviour in PHP4 ??
[email protected] ("Graham Isted") Tue, 20 Jun 2000 15:33:20 +0100
| Newsgroups | php.dev,php.general,php.migration |
|---|---|
| Message-ID | <005f01bfdac4$7c0af000$c5f931d4@desktop> |
Hola, Buenos dias! Yes, I'm using Netscape also, and of course it works fine! According to my investigations, the Cache-Control: post-check / pre-check lines are only relevant to IE5. As stated, I can get around the problem, but am very interested to know why the HEADER output for the same PHPLIB code is different depending on whether it was processed by PHP3 or PHP4? Any more thoughts / comments? Graham Isted Selenia Limited ----- Original Message ----- From: "Webmaster" <[email protected]> To: "'Graham Isted'" <[email protected]>; <[email protected]> Sent: Tuesday, June 20, 2000 3:03 PM Subject: RE: [PHP-GENERAL] New header function behaviour in PHP4 ?? Hola, Have you consider using Netscape to test these scripts? Some versions of IE do behave wird, I have similar problems using ASP to force expiration of a page. Eduardo Jordán G. Webmaster -----Original Message----- From: Graham Isted [SMTP:[email protected]] Sent: Tuesday, June 20, 2000 4:48 AM To: [email protected] Subject: [PHP-GENERAL] New header function behaviour in PHP4 ?? Hi I've been writing a shop using PHP / PHPLIB / APACHE, developing on Windows for a BSD server. I recently upgraded to PHP4 on my Windows machine, but my server provider is still at PHP3. I have noticed what I think is difference to the HEADER function behaviour in PHP4: I didn't want any of my pages to be cached, so I've set the PHPLIB session to allowcache=no, which at version 7.2b sends the following HTTP cache-related HEADERS: default: header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-cache"); header("Cache-Control: post-check=0, pre-check=0"); header("Pragma: no-cache"); break; In PHP4, this works fine, but using IE5 on PHP3 on the server, when I go BACK on the browser then IE gets the page from cache, despite the expiry date being in the past. The cache-related headers which I see returned if I Telnet to the relevant hosts are: FOR PHP3: Expires: Mon, 26 Jul 1997 05:00:00 GMT Last-Modified: Mon, 19 Jun 2000 09:59:38 GMT Cache-Control: post-check=0, pre-check=0 Pragma: no-cache FOR PHP4: Cache-Control: no-cache, post-check=0, pre-check=0 Expires: Mon, 26 Jul 1997 05:00:00 GMT Pragma: no-cache Last-Modified: Mon, 19 Jun 2000 10:18:16 GMT I found I could get round this problem on IE5 on PHP3 by changing PHPLIB session.inc to: default: header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-cache"); # header("Cache-Control: post-check=0, pre-check=0"); header("Pragma: no-cache"); break; .. or .... default: header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); # header("Cache-Control: no-cache"); header("Cache-Control: no-cache, post-check=0, pre-check=0"); header("Pragma: no-cache"); break; When I use the latter of the above variants, the returned cache-related headers are: FOR PHP3 Expires: Mon, 26 Jul 1997 05:00:00 GMT Last-Modified: Tue, 20 Jun 2000 08:43:40 GMT Cache-Control: no-cache, post-check=0, pre-check=0 Pragma: no-cache (only change is of course the addition of NO-CACHE in the Cache-Control header) FOR PHP4 Cache-Control: no-cache, post-check=0, pre-check=0 Expires: Mon, 26 Jul 1997 05:00:00 GMT Pragma: no-cache Last-Modified: Mon, 20 Jun 2000 08:57:00 GMT (ie no change) I would have to assume therefore, that PHP4's HEADER function is behaving differently from that in PHP3 (perhaps it is concatenating Cache-Control statements where there is more than one!?) Can someone from the PHP Dev team possibly clarify exactly what the internals of the HEADER function do Thanks GRAHAM ISTED