When you refresh a web page the images on it are normally cached. This means if you make a change to an image and refresh the page that it is on, the image will appear unchanged because the browser is using the cached version.
To get round this you can force the image to be reloaded by adding parameters to the image url.
ie for image
<img src="/images/image1.jpg" >
To force refresh change to
<img src="/images/image1.jpg?id=11" >
incrementing the value of the id variable in the url will force the image to be reloaded. Therefore a counter is required . The easiest way to set the counter in php is to set the id to the time function which is a number that increments with the time.
<img src="/images/image1.jpg?id=<?=time()?>" >
Monday, June 29, 2009
Subscribe to:
Post Comments (Atom)

No comments:
Post a Comment