From 1c073bea62ce854448d15bac05362ec8ecba763e Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sat, 27 Feb 2010 10:20:17 -0600 Subject: Ensure our cache is correct with AJAX requests Since the same URLs serve two different responses based on the request being AJAX or not, we want to ensure we don't cache the wrong one and serve it up incorrectly. Signed-off-by: Dan McGee --- packages/views.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'packages') diff --git a/packages/views.py b/packages/views.py index c5f87865..e95d4a2b 100644 --- a/packages/views.py +++ b/packages/views.py @@ -7,6 +7,7 @@ from django.contrib.auth.models import User from django.contrib.auth.decorators import permission_required from django.contrib.admin.widgets import AdminDateWidget +from django.views.decorators.vary import vary_on_headers from django.views.generic import list_detail from django.db.models import Q @@ -178,6 +179,7 @@ def search(request, page=None): template_object_name="package", extra_context=page_dict) +@vary_on_headers('X-Requested-With') def files(request, name='', repo='', arch=''): pkg = get_object_or_404(Package, pkgname=name, repo__name__iexact=repo, arch__name=arch) -- cgit v1.2.3-54-g00ecf