There is a blog where I can post images and links, no scripts. I still want to have dynamic content.
My idea: image that has no-cache etc. headers and is dynamically generated by my own server-side php script. This image links to a page on my server, that sets cookie and does javascript history.back(). Then next time the image is downloaded, it is a different image.
Problem is, I can't get browsers to download the image again after back button is pressed...
I have set following headers:
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header('Cache-Control: no-cache, no-store, must-revalidate'); // HTTP 1.1.
header('Pragma: no-cache'); // HTTP 1.0.
header('Expires: 0'); // Proxies.
Still for some reason if the image is inside a tag, the old version is loaded from cache when going back.
Also I included the image on the seccond page, so browser did even download the new version of the image, but when i pressed the back button, I was still presented with the old version...
How can I force browser to download the image again?