1 2 3 4 5 6 7 8 9 | frm django.shortcuts import render_to_response def render_to_json(*args, **kwargs): response = render_to_response(*args, **kwargs) response['mimetype'] = "text/javascript" response['Pragma'] = "no cache" response['Cache-Control'] = "no-cache, must-revalidate" return response |
Comments
JSON doesn't necessarily mean no cache. Don't blindly copy-paste; think about if your data can be cached.
#