replace never_cache with no-cache
@@ -2,7 +2,6 @@ from functools import wraps
from django.http import HttpResponseNotModified, HttpResponseRedirect
from django.shortcuts import render
-from django.views.decorators.cache import never_cache
from c3nav.editor.models import ChangeSet
from c3nav.mapdata.models.access import AccessPermission
@@ -27,11 +26,15 @@ def sidebar_view(func=None, select_related=None):
return render(request, 'editor/redirect.html', {'target': response['location']})
if not isinstance(response, HttpResponseNotModified):
response.write(render(request, 'editor/fragment_nav.html', {}).content)
+ response['Cache-Control'] = 'no-cache'
return response
if isinstance(response, HttpResponseRedirect):
return response
- return render(request, 'editor/map.html', {'content': response.content})
- return never_cache(with_ajax_check)
+ response = render(request, 'editor/map.html', {'content': response.content})
+ response['Cache-Control'] = 'no-cache'
+ return response
+
+ return with_ajax_check
def etag_func(request, *args, **kwargs):
