From Django i overwrite a existing photo.This photo is the profile picture of a user.I save the picture evertime as username.png on the server.So After which when the redirect is do开发者_如何学Gone to /home page the old picture is cached by the browser.
How to overcome this problem
return HttpResponseRedirect('/home/')
See this resource for information on how to set the cache headers.
http://docs.djangoproject.com/en/dev/topics/cache/
Sets the Last-Modified header to the current date/time when a fresh (uncached) version of the page is requested. Sets the Expires header to the current date/time plus the defined CACHE_MIDDLEWARE_SECONDS. Sets the Cache-Control header to give a max age for the page -- again, from the CACHE_MIDDLEWARE_SECONDS setting.
Controlling these settings will ensure that the content that you don't want cached will be refreshed when the content is changed.
精彩评论