summaryrefslogtreecommitdiff
path: root/django/utils/cache.py
Commit message (Collapse)AuthorAgeFilesLines
...
* [py3] Encoded value before feeding it to hashlib.md5Claude Paroz2012-08-121-3/+3
|
* [py3] Ported django.utils.encoding.Aymeric Augustin2012-08-071-2/+2
| | | | | | | | | | | * Renamed smart_unicode to smart_text (but kept the old name under Python 2 for backwards compatibility). * Renamed smart_str to smart_bytes. * Re-introduced smart_str as an alias for smart_text under Python 3 and smart_bytes under Python 2 (which is backwards compatible). Thus smart_str always returns a str objects. * Used the new smart_str in a few places where both Python 2 and 3 want a str.
* Removed unneeded smart_str in cache utils.Claude Paroz2012-05-281-2/+2
|
* Fixed #17476 -- Ensure timezone-dependant cache keys only use ASCII ↵Aymeric Augustin2011-12-291-4/+7
| | | | | | characters, especially on Windows. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17286 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed a CacheKeyWarning under Windows.Aymeric Augustin2011-12-271-1/+3
| | | | git-svn-id: http://code.djangoproject.com/svn/django/trunk@17277 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Added support for time zones. Thanks Luke Plant for the review. Fixed #2626.Aymeric Augustin2011-11-181-1/+4
| | | | | | | | | For more information on this project, see this thread: http://groups.google.com/group/django-developers/browse_thread/thread/cf0423bbb85b1bbf git-svn-id: http://code.djangoproject.com/svn/django/trunk@17106 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Made the cache locale-dependant when USE_L10N is True, even if USE_I18N is ↵Aymeric Augustin2011-11-011-1/+1
| | | | | | False. Refs #5691. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17061 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed several problems that hid one another in the cache tests and code.Aymeric Augustin2011-10-261-1/+1
| | | | | | | | | | | | | 1 - Used django.test.TestCase instead of unittest.TestCase so that the override_settings decorator works. 2 - Reverted parts of r17039 that caused failures (masked until 1). 3 - Isolated tests by clearing the cache in tear down (masked until 1). Refs #11505. 4 - Fixed a bug in cache key generation (revealed by 3). 5 - Fixed a test that relied on this bug -- hardcoding the generated cache keys in tests isn't a very good idea anyway. 6 - Uniformized some parts of the cache tests. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17042 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #16003 -- Restored compatibility of the admin when using USE_ETAGS. ↵Jannis Leidel2011-09-081-1/+8
| | | | | | Thanks for the initial patch, pterk. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16729 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #15499 -- Ensure that cache control headers don't try to set public ↵Russell Keith-Magee2011-08-231-0/+6
| | | | | | and private as a result of multiple calls to patch_cache_control with different arguments. Thanks to AndiDog for the report and patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16657 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #16225 -- Removed unused imports. Many thanks to Aymeric Augustin for ↵Jannis Leidel2011-07-131-1/+0
| | | | | | the work on the patch and Alex for reviewing. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16539 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Removed a bunch more Python 2.4 workarounds now that we don't support that ↵Adrian Holovaty2011-03-281-5/+5
| | | | | | version. Refs #15702 -- thanks to jonash for the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15927 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #4992 -- Respect the GET request query string when creating cache ↵Jannis Leidel2011-03-021-7/+7
| | | | | | 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
* Fixed #13283 -- Corrected CACHE_MIDDLEWARE_ANONYMOUS_ONLY's bad habit of ↵Carl Meyer2011-02-011-0/+10
| | | | | | setting Vary: Cookie on all responses and destroying cache efficiency. Thanks to natrius for the fix. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15381 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Beefed up the tests for multi-cache handling of the cache middleware and ↵Russell Keith-Magee2010-12-221-3/+7
| | | | | | view decorators, and made a couple of tweaks for edge cases as a result. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15021 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #14103 -- Take USE_ETAGS setting into account when patching the ↵Jannis Leidel2010-12-121-1/+1
| | | | | | response headers. Thanks, trbs and Eric Holscher. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14885 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #14560 -- Enable HEAD requests to be cached properly. Thanks, codemonkey!Honza Král2010-10-291-7/+7
| | | | | | | | Introducing ability to cache HEAD requests and GET requests separately by adding the method to the cache key while preserving the functionality that HEAD requests can use cached reponses generated by a GET request. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14391 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Refined changes made in r12546 to also respect the request.LANGUAGE_CODE in ↵Jannis Leidel2010-03-011-7/+12
| | | | | | case the LocaleMiddleware is used to discover the language preference. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12624 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #5691 - Adds the active language to the cache key. Thanks, Antoni ↵Jannis Leidel2010-02-231-7/+11
| | | | | | Aloy, Ramiro Morales and Yann Malet. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12546 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #10016: the cache middleware no longer vomits when handed long URLs. ↵Jacob Kaplan-Moss2009-04-011-3/+5
| | | | | | Thanks, Matt Croydon. git-svn-id: http://code.djangoproject.com/svn/django/trunk@10335 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #10387: removed some code duplication in django.utils.cache. Thanks, ↵Jacob Kaplan-Moss2009-03-301-4/+7
| | | | | | Travis Swicegood. git-svn-id: http://code.djangoproject.com/svn/django/trunk@10223 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed typo in comment.Gary Wilson Jr2008-08-151-1/+1
| | | | git-svn-id: http://code.djangoproject.com/svn/django/trunk@8382 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #7919 -- md5 and sha modules are deprecated since Python 2.5, use ↵Gary Wilson Jr2008-08-021-3/+3
| | | | | | hashlib module when available. Patch from Karen Tracey. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8193 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #7228 -- Fixed our ETag header creation to meet the HTTP spec, by ↵Adrian Holovaty2008-06-161-1/+1
| | | | | | quoting it. Thanks, skjohn@us.ibm.com git-svn-id: http://code.djangoproject.com/svn/django/trunk@7659 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #5813 -- Taught the CacheMiddleware to respect any max-age HTTP headerMalcolm Tredinnick2007-11-291-0/+22
| | | | | | | when setting the expiry time. Thanks, SmileyChris. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6736 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Some minor changes to the `patch_vary_headers` function:Gary Wilson Jr2007-11-191-7/+12
| | | | | | | | | * Replaced a for loop with a list comprehension. * Used a set instead of a dict with dummy values. * Used a bit more readable variable names. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6698 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Removed `vary_delim_re` in `django/utils/cache.py` in favor of existing ↵Gary Wilson Jr2007-11-191-4/+2
| | | | | | `cc_delim_re` since the latter is more correct in parsing the header (allows whitespace before and after comma separators instead of just after). As a bonus, tests added for `patch_vary_headers()`. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6696 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #5816 -- Fixed a regression from [6333] that generates incorrect ↵Gary Wilson Jr2007-10-311-3/+3
| | | | | | cookie "expires" dates when using a locale other than English. Introduced `http_date` and `cookie_date` utility functions. Thanks for the report Michael Lemaire. Thanks for the patch Karen Tracey and `SmileyChris`. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6634 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Corrected a typo and made some style fixes.Gary Wilson Jr2007-10-281-10/+14
| | | | git-svn-id: http://code.djangoproject.com/svn/django/trunk@6626 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #5557: URLs are now properly escaped in the cache_page decorator. ↵Jacob Kaplan-Moss2007-09-281-4/+4
| | | | | | Thanks, eriks. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6435 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #5047: patch_cache_control now respects existing max-age settings. ↵Jacob Kaplan-Moss2007-09-281-0/+7
| | | | | | Thanks, permon. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6434 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #4071 -- Fixed bug in cache_page decorator, which was setting the ↵Adrian Holovaty2007-09-141-2/+2
| | | | | | wrong header. Thanks, Ionut Ciocirlan (xlotlu) and permon git-svn-id: http://code.djangoproject.com/svn/django/trunk@6222 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #4199 -- Changed date formatting in HTTP expires header to be specMalcolm Tredinnick2007-07-161-8/+9
| | | | | | | compliant. Thanks, Chris Bennett. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5712 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Merged Unicode branch into trunk (r4952:5608). This should be fullyMalcolm Tredinnick2007-07-041-1/+2
| | | | | | | | | backwards compatible for all practical purposes. Fixed #2391, #2489, #2996, #3322, #3344, #3370, #3406, #3432, #3454, #3492, #3582, #3690, #3878, #3891, #3937, #4039, #4141, #4227, #4286, #4291, #4300, #4452, #4702 git-svn-id: http://code.djangoproject.com/svn/django/trunk@5609 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Removed a bunch of annoying trailing whitespace.Malcolm Tredinnick2007-04-251-1/+1
| | | | git-svn-id: http://code.djangoproject.com/svn/django/trunk@5068 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* MERGED MAGIC-REMOVAL BRANCH TO TRUNK. This change is highly ↵Adrian Holovaty2006-05-021-0/+9
| | | | | | backwards-incompatible. Please read http://code.djangoproject.com/wiki/RemovingTheMagic for upgrade instructions. git-svn-id: http://code.djangoproject.com/svn/django/trunk@2809 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #1569 -- HttpResponse now accepts iterators. Thanks, ManiacAdrian Holovaty2006-04-091-1/+1
| | | | git-svn-id: http://code.djangoproject.com/svn/django/trunk@2639 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Changed django.utils.cache.patch_response_headesr to move unnecessary ↵Adrian Holovaty2006-03-171-1/+1
| | | | | | calculation of 'expires' into the 'if' statement git-svn-id: http://code.djangoproject.com/svn/django/trunk@2528 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #920 -- Fixed patch_response_headers() behavior when content is ↵Adrian Holovaty2006-01-151-1/+1
| | | | | | Unicode. Thanks, Sune Kirkeby git-svn-id: http://code.djangoproject.com/svn/django/trunk@1980 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Made several grammar fixes to cache documentation from [1020]Adrian Holovaty2005-10-311-9/+7
| | | | git-svn-id: http://code.djangoproject.com/svn/django/trunk@1030 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #612 - added cache control headers (thanks, hugo)Jacob Kaplan-Moss2005-10-291-2/+40
| | | | git-svn-id: http://code.djangoproject.com/svn/django/trunk@1020 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Moved vary decorators from django.utils.cache to django.views.decorators.varyAdrian Holovaty2005-10-091-38/+4
| | | | git-svn-id: http://code.djangoproject.com/svn/django/trunk@809 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Added django.utils.cache, from Hugo's #580 patch. Refs #580.Adrian Holovaty2005-10-081-0/+155
git-svn-id: http://code.djangoproject.com/svn/django/trunk@808 bcc190cf-cafb-0310-a4f2-bffc1f526a37