Forum Moderators: coopster
As I recently added some ajax functionality to my page, this image generation is now an issue. Essentially, a user would rate an object, the page would refresh as the rating was submitted and when the user was taken back to the page, the new image would load with the new data they had just submitted. As this rating system now uses ajax, there is no page refresh happening anymore...
The image is of the format
<img src="/graph/ratings.php?x=300&y=150" />
I use js to write out a new image tag with the new data upon success of the ajax call, and if I load the image in a new window, it is properly updated, but on the page the user is using and has already seen the image prior to updating the underlying data, the browser is seeing the image url as being the same and not 're-loading' the image at all.
A solution I've tried is adding some random txt to the url, so that the browser thinks it's a new image. This works, but seems like a hack.
So, is there a way in the called php script I could set the headers or something on this particular image so that it is never cached, not even for the user session?
Thanks,
P