diff --git a/django_mobile/middleware.py b/django_mobile/middleware.py index 9ce62bd..76ee8d7 100644 --- a/django_mobile/middleware.py +++ b/django_mobile/middleware.py @@ -1,4 +1,6 @@ import re +from django.utils.cache import patch_vary_headers + from django_mobile import flavour_storage from django_mobile import set_flavour, _init_flavour from django_mobile.conf import settings @@ -78,3 +80,7 @@ def process_request(self, request): set_flavour(settings.DEFAULT_MOBILE_FLAVOUR, request) else: set_flavour(settings.FLAVOURS[0], request) + + def process_response(self, request, response): + patch_vary_headers(response, ('User-Agent',)) + return response