1. Yohan Boniface
  2. django-leaflet-storage

Commits

Yohan Boniface  committed fc31d03

Add must_revalidate header for datalayer geojson view

  • Participants
  • Parent commits 8e5f289
  • Branches master

Comments (0)

Files changed (1)

File leaflet_storage/urls.py

View file
 from django.conf.urls import patterns, url
 from django.contrib.auth.views import login
 from django.views.decorators.csrf import ensure_csrf_cookie
-from django.views.decorators.cache import never_cache
+from django.views.decorators.cache import never_cache, cache_control
 
 from . import views
 from .decorators import jsonize_view, map_permissions_check,\
     url(r'^map/(?P<username>[-_\w]+)/(?P<slug>[-_\w]+)/$', views.MapOldUrl.as_view(), name='map_old_url'),
     url(r'^map/anonymous-edit/(?P<signature>.+)$', views.MapAnonymousEditUrl.as_view(), name='map_anonymous_edit_url'),
     url(r'^m/(?P<pk>\d+)/$', views.MapShortUrl.as_view(), name='map_short_url'),
-    url(r'^datalayer/(?P<pk>[\d]+)/$', views.DataLayerView.as_view(), name='datalayer_view'),
     url(r'^pictogram/json/$', views.PictogramJSONList.as_view(), name='pictogram_list_json'),
 )
+urlpatterns += decorated_patterns('', [cache_control(must_revalidate=True), ],
+    url(r'^datalayer/(?P<pk>[\d]+)/$', views.DataLayerView.as_view(), name='datalayer_view'),
+)
 urlpatterns += decorated_patterns('', [ensure_csrf_cookie, ],
     url(r'^map/(?P<slug>[-_\w]+)_(?P<pk>\d+)$', views.MapView.as_view(), name='map'),
     url(r'^map/new/$', views.MapNew.as_view(), name='map_new'),