From: Radek Czajka Date: Fri, 29 Mar 2013 12:43:19 +0000 (+0100) Subject: catalogue view: cache vary on is_ajax X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/12aefaa8ec09e42f4912f952dbf08b4929cda7be?ds=sidebyside;hp=-c catalogue view: cache vary on is_ajax --- 12aefaa8ec09e42f4912f952dbf08b4929cda7be 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)