I am accessing a link on my site that will provide a new image each time it is accessed.
The issue I am running into is that if I try to load the image in the backgr
One answer is to hackishly add some get query parameter like has been suggested.
A better answer is to emit a couple of extra options in your HTTP header.
Pragma: no-cache
Expires: Fri, 30 Oct 1998 14:19:41 GMT
Cache-Control: no-cache, must-revalidate
By providing a date in the past, it won't be cached by the browser. Cache-Control
was added in HTTP/1.1 and the must-revalidate tag indicates that proxies should never serve up an old image even under extenuating circumstances, and the Pragma: no-cache
isn't really necessary for current modern browsers/caches but may help with some crufty broken old implementations.