note 50810 added to function.header

From: Date: Thu, 10 Mar 2005 16:03:01 +0000
Subject: note 50810 added to function.header
Groups: php.notes 
Request: Send a blank email to php-notes+get-86208@lists.php.net to get a copy of this message
These headers only works with include, css, js, html, etc. But doesn't work with images files (jpg, gif, etc.) 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-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); To no cache images you can use a trick: $var = md5(time()); $picture_name = "picture.jpg?var=".$var; picture.jpg is the name of the file that you don't want cache. ---- Manual Page -- http://www.php.net/manual/en/function.header.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+50810 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+50810&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+50810&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+50810&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+50810&report=yes&reason=useless Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+50810&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+50810&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#86208) next »