After updating a model instance, I redirect back to this instance "detail page". Part of the model is an image generated from the models content. In this redirect I want to force the browser to reload the image from the server. I tried it with headers but that doesn't work:
response = HttpResponseRedirect('/target/path/')
response['Cache-Control'] = 'no-cache'
response['Pragma'] = 'no-cache'
return response
Because I assume the redirect loses the headers.
How can I force the page to reload the image but only after user returns from update page?
EDIT:
the image is served in an img tag. The src actually points to a server end-point that generates the image form the "id" in the src link. Then the image should be cached until it changes.