note 85146 added to function.header

From: Date: Sun, 17 Aug 2008 06:41:18 +0000
Subject: note 85146 added to function.header
Groups: php.notes 
Request: Send a blank email to php-notes+get-143567@lists.php.net to get a copy of this message
You can use HTTP's etags and last modified dates to ensure that you're not sending the browser data it already has cached. <?php $last_modified_time = filemtime($file); $etag = md5_file($file); header("Last-Modified: ".gmdate("D, d M Y H:i:s", $last_modified_time)." GMT"); header("Etag: $etag"); if (@strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) == $last_modified_time || trim($_SERVER['HTTP_IF_NONE_MATCH']) == $etag) { header("HTTP/1.1 304 Not Modified"); exit; } ---- Server IP: 209.41.74.194 Probable Submitter: 69.234.64.50 ---- Manual Page -- http://www.php.net/manual/en/function.header.php Edit -- https://master.php.net/note/edit/85146 Del: integrated -- https://master.php.net/note/delete/85146/integrated Del: useless -- https://master.php.net/note/delete/85146/useless Del: bad code -- https://master.php.net/note/delete/85146/bad+code Del: spam -- https://master.php.net/note/delete/85146/spam Del: non-english -- https://master.php.net/note/delete/85146/non-english Del: in docs -- https://master.php.net/note/delete/85146/in+docs Del: other reasons-- https://master.php.net/note/delete/85146 Reject -- https://master.php.net/note/reject/85146 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#143567) next »