note 75394 deleted from function.header by tularis

From: Date: Fri, 04 Apr 2014 11:30:27 +0000
Subject: note 75394 deleted from function.header by tularis
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-199168@lists.php.net to get a copy of this message
Note Submitter: Jean-Pierre ---- 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: <?php print "<img src='yourfile.jpg'>"; ?> into: <?php print "<img src='yourfile.jpg?".time()."'>"; ?> This adds an unique number to the url and wont hurt at all.

« previous php.notes (#199168) next »