Hi
This script modifies an image from an ajax call. The image displays ok becasue I have added a query string to the of the filename response. When viewed elsewhere on the site, the old image is displayed from cache.
How can I get the new image to load the updated version througout the site without loading everything not from cache?
<?
$direction = $_POST['direction'];
// File
$filename = $_POST['filename'];
$filename = explode("?",$filename);
$filename = $filename[0];
// Rotation
if ($direction=='left')
$degrees = 270;
if ($direction=='right')
$degrees = 90;
// Content type
header('Content-type: image/jpeg');
// Load
$source = imagecreatefromjpeg($filename);
// Rotate
$rotate = imagerotate($source, $degrees, 0);
// Output
imagejpeg($rotate,$filename);
echo $filename."?q=".rand(1,1000);
?>