Django & cache headers

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
from django.views.decorators.cache import cache_control
from someproj.someapp.views import foo_view

# ...

open_cache = cache_control(private=True, public=True)

urlpatterns = patterns('',
    (r'^foo/$', open_cache(foo_view)),
    # ...
)

More like this

  1. Serving null files by ludvig.ericson 6 years, 2 months ago
  2. common model privacy by teepark 5 years, 10 months ago
  3. Debug-only static serving by ludvig.ericson 5 years, 4 months ago
  4. Search results pagination by polarbear 6 years, 1 month ago
  5. Improved Accept header middleware by ludvig.ericson 4 years, 8 months ago

Comments

(Forgotten your password?)