From 12aefaa8ec09e42f4912f952dbf08b4929cda7be Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Fri, 29 Mar 2013 13:43:19 +0100 Subject: [PATCH] catalogue view: cache vary on is_ajax --- apps/catalogue/views.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/catalogue/views.py b/apps/catalogue/views.py index 6dd3d7ec1..e61feb6c2 100644 --- a/apps/catalogue/views.py +++ b/apps/catalogue/views.py @@ -19,6 +19,7 @@ from django.utils.http import urlquote_plus from django.utils import translation from django.utils.translation import ugettext as _, ugettext_lazy from django.views.decorators.cache import never_cache +from django.views.decorators.vary import vary_on_headers from ajaxable.utils import JSONResponse, AjaxableFormView from catalogue import models @@ -34,6 +35,7 @@ staff_required = user_passes_test(lambda user: user.is_staff) permanent_cache = get_cache('permanent') +@vary_on_headers('X-Requested-With') def catalogue(request): tags = models.Tag.objects.exclude( category__in=('set', 'book')).exclude(book_count=0) -- 2.20.1