I'm returning an image (png) from a call to an action method and I'd like to stop the image being cached by the browser.
return File(reply, "image/png", "{0}_Graph".FormatWith(ciName));
I've tried all the usual things, appending an array of different headers to the file output response and none of them seem to be working for me.
Basically my action method returns a graph that's generated on the server and could be different from moment to moment. I use Javascripts Image
object on the client side and set its src
to my action method.
var image = new Image();
image.src = baseUrl + params;
Each time the same URL is requested, the server is not hit.
I can append a random number etc to the querystring however I'm wondering if there's a better approach.