1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #20346 -- Made cache middleware vary on the full URL.

Previously, only the URL path was included in the cache key.

Thanks jamey for the suggestion.
This commit is contained in:
ijl
2013-12-26 23:14:08 -05:00
committed by Tim Graham
parent 280c1a65cc
commit 71a03e01aa
4 changed files with 92 additions and 19 deletions

View File

@@ -622,6 +622,19 @@ cache-specific errors. This has been fixed in Django 1.7, see
.. _Ticket #21200: https://code.djangoproject.com/ticket/21200
Cache keys are now generated from the request's absolute URL
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Previous versions of Django generated cache keys using a request's path and
query string but not the scheme or host. If a Django application was serving
multiple subdomains or domains, cache keys could collide. In Django 1.7, cache
keys vary by the absolute URL of the request including scheme, host, path, and
query string. For example, the URL portion of a cache key is now generated from
``http://www.example.com/path/to/?key=val`` rather than ``/path/to/?key=val``.
The cache keys generated by Django 1.7 will be different from the keys
generated by older versions of Django. After upgrading to Django 1.7, the first
request to any previously cached URL will be a cache miss .
Passing ``None`` to ``Manager.db_manager()``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~