I have a div tag on my site that uses a background image. When we make a tiny text change in that image and ftp it back to the server, it continues to serve it as 304 not modified and uses the cached version. Only until we force a browser refresh does it fetch the new image.
I’ve read where you can set Cache-Control to no-cache in the HTTP Response Headers (I’m using IIS 7.5), but that still does nothing, still uses the cached image and sends back a 304. My workaround was to rename the image and also change the div’s css and that does work, but I’m looking for a better way. Ideally, we want this single image to be dynamic so we can change it often, but we don’t want our customers to have to know to refresh their browsers.
Is there a solution?
Changing url is most common workaround.
In my case, when I’ve experienced such issue, I’ve moved image in separate controller(or it may be page, or even hadler), and was adding little url param, which was generated by
datetimeclass, e.g.: