Index: docs/topics/cache.txt
===================================================================
--- docs/topics/cache.txt	(Revision 13963)
+++ docs/topics/cache.txt	(Arbeitskopie)
@@ -731,8 +731,8 @@
 said to "vary on language."
 
 By default, Django's cache system creates its cache keys using the requested
-path (e.g., ``"/stories/2005/jun/23/bank_robbed/"``). This means every request
-to that URL will use the same cached version, regardless of user-agent
+path and query -- e.g., ``"/stories/2005/?order_by=author"``. This means every 
+request to that URL will use the same cached version, regardless of user-agent
 differences such as cookies or language preferences. However, if this page
 produces different content based on some difference in request headers -- such
 as a cookie, or a language, or a user-agent -- you'll need to use the ``Vary``
Index: django/utils/cache.py
===================================================================
--- django/utils/cache.py	(Revision 13963)
+++ django/utils/cache.py	(Arbeitskopie)
@@ -150,21 +150,21 @@
         value = request.META.get(header, None)
         if value is not None:
             ctx.update(value)
-    path = md5_constructor(iri_to_uri(request.path))
+    path = md5_constructor(iri_to_uri(request.get_full_path()))
     cache_key = 'views.decorators.cache.cache_page.%s.%s.%s' % (
         key_prefix, path.hexdigest(), ctx.hexdigest())
     return _i18n_cache_key_suffix(request, cache_key)
 
 def _generate_cache_header_key(key_prefix, request):
     """Returns a cache key for the header cache."""
-    path = md5_constructor(iri_to_uri(request.path))
+    path = md5_constructor(iri_to_uri(request.get_full_path()))
     cache_key = 'views.decorators.cache.cache_header.%s.%s' % (
         key_prefix, path.hexdigest())
     return _i18n_cache_key_suffix(request, cache_key)
 
 def get_cache_key(request, key_prefix=None):
     """
-    Returns a cache key based on the request path. It can be used in the
+    Returns a cache key based on the request path and query. It can be used in the
     request phase because it pulls the list of headers to take into account
     from the global path registry and uses those to build a cache key to check
     against.
@@ -206,7 +206,7 @@
         return _generate_cache_key(request, headerlist, key_prefix)
     else:
         # if there is no Vary header, we still need a cache key
-        # for the request.path
+        # for the request.get_full_path()
         cache.set(cache_key, [], cache_timeout)
         return _generate_cache_key(request, [], key_prefix)
 
Index: django/middleware/cache.py
===================================================================
--- django/middleware/cache.py	(Revision 13963)
+++ django/middleware/cache.py	(Arbeitskopie)
@@ -23,7 +23,7 @@
 
 More details about how the caching works:
 
-* Only parameter-less GET or HEAD-requests with status code 200 are cached.
+* Only GET or HEAD-requests with status code 200 are cached.
 
 * The number of seconds each page is stored for is set by the "max-age" section
   of the response's "Cache-Control" header, falling back to the
@@ -115,7 +115,7 @@
         if self.cache_anonymous_only:
             assert hasattr(request, 'user'), "The Django cache middleware with CACHE_MIDDLEWARE_ANONYMOUS_ONLY=True requires authentication middleware to be installed. Edit your MIDDLEWARE_CLASSES setting to insert 'django.contrib.auth.middleware.AuthenticationMiddleware' before the CacheMiddleware."
 
-        if not request.method in ('GET', 'HEAD') or request.GET:
+        if not request.method in ('GET', 'HEAD'):
             request._cache_update_cache = False
             return None # Don't bother checking the cache.
 
Index: django/http/__init__.py
===================================================================
--- django/http/__init__.py	(Revision 13963)
+++ django/http/__init__.py	(Arbeitskopie)
@@ -61,7 +61,10 @@
         return host
 
     def get_full_path(self):
-        return ''
+        # RFC 3986 requires query string arguments to be in the ASCII range.
+        # Rather than crash if this doesn't happen, we encode defensively.
+        # taken from django/core/handlers/wsgi.py
+        return '%s%s' % (self.path, self.META.get('QUERY_STRING', '') and ('?' + iri_to_uri(self.META.get('QUERY_STRING', ''))) or '')
 
     def build_absolute_uri(self, location=None):
         """
Index: tests/regressiontests/cache/tests.py
===================================================================
--- tests/regressiontests/cache/tests.py	(Revision 13963)
+++ tests/regressiontests/cache/tests.py	(Arbeitskopie)
@@ -14,7 +14,7 @@
 from django.core import management
 from django.core.cache import get_cache
 from django.core.cache.backends.base import InvalidCacheBackendError, CacheKeyWarning
-from django.http import HttpResponse, HttpRequest
+from django.http import HttpResponse, HttpRequest, QueryDict
 from django.middleware.cache import FetchFromCacheMiddleware, UpdateCacheMiddleware
 from django.utils import translation
 from django.utils.cache import patch_vary_headers, get_cache_key, learn_cache_key
@@ -588,12 +588,15 @@
         request.path = request.path_info = self.path
         return request
 
-    def _get_request_cache(self):
+    def _get_request_cache(self, query_string=None):
         request = HttpRequest()
         request.META = {
             'SERVER_NAME': 'testserver',
             'SERVER_PORT': 80,
         }
+        if query_string:
+            request.META['QUERY_STRING']=query_string
+            request.GET=QueryDict(query_string)
         request.path = request.path_info = self.path
         request._cache_update_cache = True
         request.method = 'GET'
@@ -629,9 +632,28 @@
         settings.CACHE_MIDDLEWARE_KEY_PREFIX="test"
         settings.CACHE_BACKEND='locmem:///'
         settings.USE_I18N = True
+
+        # cache with non empty request.GET
+        request = self._get_request_cache(query_string='foo=bar&other=true')
+        get_cache_data = FetchFromCacheMiddleware().process_request(request)
+        # first access, cache must return None
+        self.assertEqual(get_cache_data, None)
+        response = HttpResponse()
+        content='Check for cache with QUERY_STRING'
+        response.content=content
+        UpdateCacheMiddleware().process_response(request, response)
+        get_cache_data = FetchFromCacheMiddleware().process_request(request)
+        # cache must return content
+        self.assertNotEqual(get_cache_data, None) # request with QUERY_STRING not cached.
+        self.assertEqual(get_cache_data.content, content)
+        request = self._get_request_cache(query_string='foo=bar&somethingelse=true')
+        get_cache_data = FetchFromCacheMiddleware().process_request(request)
+        # different QUERY_STRING, cache must be empty
+        self.assertEqual(get_cache_data, None)
+
+        # i18n tests
         en_message ="Hello world!"
         es_message ="Hola mundo!"
-
         request = self._get_request_cache()
         set_cache(request, 'en', en_message)
         get_cache_data = FetchFromCacheMiddleware().process_request(request)
