Thanks stymiee !
but do you think this is an efficient solution? The number of files will get increasing and that need to be deleted.
Is it possible to disable the cahing?
Regards!
There's no reliable way to disable caching. You can send send out headers to prevent caching but I've found this to not be 100% effective. A better solution might be to use PHP to output the image. Then you can append a timestamp to the filename to make it look unique: <img src="/images/chart.php?1091343214">.
The php code in chart.php would look like this:
<?php
header('Content-type: image/gif');
$fn = fopen("./chart.gif", "r");
fpassthru($fn);
?>
If the PHP generated bar graph image is being saved as a file, then you can also use the method suggested by stymiee with the timestamp directly on the image...
eg:
<img src="/images/chart.jpg?1091343214" />
Even though its a jpg extension it should still bypass most HTTP caches (I have not tested this though). That way you don't have to pass the image data to PHP.
Reputation Points: 457
Solved Threads: 101
Nearly a Posting Virtuoso
Offline 1,250 posts
since Sep 2005