From f6c991667f6f1ab8d2fd2afc1ee2b5801e78b7e3 Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Wed, 2 Mar 2011 12:47:36 +0000 Subject: Fixed #4992 -- Respect the GET request query string when creating cache keys. Thanks PeterKz and guettli for the initial patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15705 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- docs/releases/1.3.txt | 3 +++ docs/topics/cache.txt | 8 ++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/releases/1.3.txt b/docs/releases/1.3.txt index 29e4fd46f5..66f78ba0c4 100644 --- a/docs/releases/1.3.txt +++ b/docs/releases/1.3.txt @@ -169,6 +169,9 @@ Secondly, :ref:`Versioning `, :ref:`site-wide prefixing ` and :ref:`transformation ` has been added to the cache API. +Thirdly, the :ref:`cache key creation ` has been +updated to take the GET request query string into account. + Lastly, support for pylibmc_ has been added to the memcached cache backend. diff --git a/docs/topics/cache.txt b/docs/topics/cache.txt index 5acd53eeb8..4eb9d21536 100644 --- a/docs/topics/cache.txt +++ b/docs/topics/cache.txt @@ -962,9 +962,13 @@ mechanism should take into account when building its cache key. For example, if the contents of a Web page depend on a user's language preference, the page is said to "vary on language." +.. versionchanged:: 1.3 + In Django 1.3 the full request path -- including the query -- is used + to create the cache keys, instead of only the path component in Django 1.2. + 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`` -- cgit v1.3