Re: [Phplib-users] page expiry problems
Brought to you by:
nhruby,
richardarcher
From: Layne W. <la...@dr...> - 2003-07-01 23:20:30
|
>> Put your header declaration *after* page_open() - the default PHP >> behavior is to overwrite previously set headers of the same name. >> FWIW, when I send an image file through a PHP script, I send the >> following headers, mainly taken from session.inc: >> >> header("Expires: " . gmdate("D, d M Y H:i:s", time() + 1440 * 60) . " >> GMT"); >> header("Last-Modified: " . gmdate("D, d M Y H:i:s", >> filemtime("./logo.gif")) . " GMT"); >> header("Cache-Control: public"); >> header("Cache-Control: max-age=" . 1440 * 60, false); >> header("Pragma: public"); >> >> HTH, >> Layne Weathers > > > If PHP overwrites headers with same name, how can your example have > two "Cache-Control" headers? Notice that the second header sends a second argument, false. The *default* behavior is overwrite, but you can control that by telling PHP to append instead of overwrite. Layne Weathers |