note 75394 added to function.header
| From: | Jean-Pierre at osu1 dot php dot net | Date: | Sun, 27 May 2007 11:21:33 +0000 |
| Subject: | note 75394 added to function.header | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-126949@lists.php.net to get a copy of this message | ||
You can use the Header command to force a browser to use fresh content (no caching).
However, this only works for the HTML code your code generates. When you have updated images for
example (with the same filename) then there's a chance that these are still cached.
The easiest way to solve this problem I found is changing:
<?
print "<img src='yourfile.jpg'>";
?>
into:
<?
print "<img src='yourfile.jpg?".time()."'>";
?>
This adds an unique number to the url and wont hurt at all.
----
Server IP: 194.109.193.76
Probable Submitter: 80.140.224.133
----
Manual Page -- http://www.php.net/manual/en/function.header.php
Edit -- https://master.php.net/note/edit/75394
Del: integrated -- https://master.php.net/note/delete/75394/integrated
Del: useless -- https://master.php.net/note/delete/75394/useless
Del: bad code -- https://master.php.net/note/delete/75394/bad+code
Del: spam -- https://master.php.net/note/delete/75394/spam
Del: non-english -- https://master.php.net/note/delete/75394/non-english
Del: in docs -- https://master.php.net/note/delete/75394/in+docs
Del: other reasons-- https://master.php.net/note/delete/75394
Reject -- https://master.php.net/note/reject/75394
Search -- https://master.php.net/manage/user-notes.php