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. common model privacy by teepark 4 years, 10 months ago
  2. Decorating class-based views by lqc 3 months, 3 weeks ago
  3. Binding signals to abstract models by andreterra 1 week, 3 days ago
  4. per-function cache decorator by nicois 4 years, 4 months ago
  5. New view decorator to only cache pages for anonymous users by vaughnkoch 1 year, 7 months ago

Comments

(Forgotten your password?)