summaryrefslogtreecommitdiff
path: root/django/middleware/cache.py
Commit message (Collapse)AuthorAgeFilesLines
* Refs #33476 -- Reformatted code with Black.django-bot2022-02-071-13/+27
|
* Fixed #33252 -- Made cache middlewares thread-safe.Iuri de Silvio2021-11-031-3/+8
|
* Refs #26601 -- Made get_response argument required and don't accept None in ↵Mariusz Felisiak2021-01-141-9/+3
| | | | | | middleware classes. Per deprecation timeline.
* Fixed #31928 -- Fixed detecting an async get_response in various middlewares.Kevin Michel2020-08-281-15/+10
| | | | | | | | | | | SecurityMiddleware and the three cache middlewares were not calling super().__init__() during their initialization or calling the required MiddlewareMixin._async_check() method. This made the middlewares not properly present as coroutine and confused the middleware chain when used in a fully async context. Thanks Kordian Kowalski for the report.
* Refs #26601 -- Deprecated passing None as get_response arg to middleware ↵Claude Paroz2020-02-181-0/+9
| | | | | | | | | classes. This is the new contract since middleware refactoring in Django 1.10. Co-authored-by: Carlton Gibson <carlton.gibson@noumenal.es> Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
* Fixed #30765 -- Made cache_page decorator take precedence over max-age ↵Flavio Curella2020-01-161-9/+14
| | | | Cache-Control directive.
* Fixed #28833 -- Prevented CacheMiddleware from caching responses with ↵shanghui2018-02-061-0/+4
| | | | "Cache-Control: private".
* Refs #27656 -- Updated remaining docstring verbs according to PEP 257.Anton Samarchyan2017-03-041-2/+2
|
* Fixed #27211 -- Made UpdateCacheMiddleware include caching headers for "304 ↵Rinat Khabibiev2016-09-141-2/+2
| | | | Not Modified" responses.
* Fixed #26601 -- Improved middleware per DEP 0005.Florian Apolloner2016-05-171-10/+14
| | | | | Thanks Tim Graham for polishing the patch, updating the tests, and writing documentation. Thanks Carl Meyer for shepherding the DEP.
* Removed unnecessary arguments in .get method callsPiotr Jakimiak2015-05-131-2/+2
|
* Sorted imports with isort; refs #23860.Tim Graham2015-02-061-3/+5
|
* Removed UpdateCacheMiddleware._session_accessed()Tim Graham2015-02-011-6/+0
| | | | This method is unused since f567d04b249913db4a37adab8ba521cdc974d423
* Prevented leaking the CSRF token through caching.Aymeric Augustin2014-04-211-1/+9
| | | | This is a security fix. Disclosure will follow shortly.
* Corrected many style guide violations that the newest version of flake8 catchesAlex Gaynor2014-03-301-1/+1
|
* Removed settings.CACHE_MIDDLEWARE_ANONYMOUS_ONLY per deprecation timeline.Tim Graham2014-03-211-25/+2
| | | | refs #15201.
* Fixed #21188 -- Introduced subclasses for to-be-removed-in-django-XX warningsClaude Paroz2014-03-081-1/+2
| | | | | Thanks Anssi Kääriäinen for the idea and Simon Charette for the review.
* Fixed #21012 -- New API to access cache backends.Curtis Maloney2013-11-231-28/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Thanks Curtis Malony and Florian Apolloner. Squashed commit of the following: commit 3380495e93f5e81b80a251b03ddb0a80b17685f5 Author: Aymeric Augustin <aymeric.augustin@m4x.org> Date: Sat Nov 23 14:18:07 2013 +0100 Looked up the template_fragments cache at runtime. commit 905a74f52b24a198f802520ff06290a94dedc687 Author: Aymeric Augustin <aymeric.augustin@m4x.org> Date: Sat Nov 23 14:19:48 2013 +0100 Removed all uses of create_cache. Refactored the cache tests significantly. Made it safe to override the CACHES setting. commit 35e289fe9285feffed3c60657af9279a6a2cfccc Author: Aymeric Augustin <aymeric.augustin@m4x.org> Date: Sat Nov 23 12:23:57 2013 +0100 Removed create_cache function. commit 8e274f747a1f1c0c0e6c37873e29067f7fa022e8 Author: Aymeric Augustin <aymeric.augustin@m4x.org> Date: Sat Nov 23 12:04:52 2013 +0100 Updated docs to describe a simplified cache backend API. commit ee7eb0f73e6d4699edcf5d357dce715224525cf6 Author: Curtis Maloney <curtis@tinbrain.net> Date: Sat Oct 19 09:49:24 2013 +1100 Fixed #21012 -- Thread-local caches, like databases.
* Fixed all E261 warningscoagulant2013-11-021-3/+3
|
* More attacking E302 violatorsAlex Gaynor2013-11-021-0/+2
|
* Used "is" for comparisons with None.Tim Graham2013-10-101-1/+1
|
* Advanced deprecation warnings for Django 1.7.Aymeric Augustin2013-06-291-1/+1
|
* Fixed #15201: Marked CACHE_MIDDLEWARE_ANONYMOUS_ONLY as deprecatedŁukasz Langa2013-05-181-5/+6
|
* Prevented caching of streaming responses.Aymeric Augustin2012-12-241-1/+1
| | | | | | | The test introduced in 4b278131 accidentally passed because of a limitation of Python < 3.3. Refs #17758, #7581.
* Fixed #19347 -- Removed unused variable definition in FetchFromCacheMiddlewareClaude Paroz2012-12-011-1/+0
| | | | Thanks gregplaysguitar at gmail.com for the report.
* Fixed #4992 -- Respect the GET request query string when creating cache ↵Jannis Leidel2011-03-021-2/+2
| | | | | | 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 #15260 -- Ensured that CACHE_MIDDLEWARE_ANONYMOUS_ONLY is effective ↵Carl Meyer2011-02-171-2/+11
| | | | | | with the cache_page decorator, not only the middleware. Thanks to brodie for report and draft patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15559 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #13283 -- Corrected CACHE_MIDDLEWARE_ANONYMOUS_ONLY's bad habit of ↵Carl Meyer2011-02-011-9/+12
| | | | | | 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
* Fixed #15012 -- Added post-rendering callbacks to TemplateResponse so that ↵Russell Keith-Magee2011-01-241-1/+7
| | | | | | decorators (in particular, the cache decorator) can defer processing until after rendering has occurred. Thanks to Joshua Ginsberg for the draft patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15295 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #15144 -- Corrected some problems with the Cache middleware when used ↵Russell Keith-Magee2011-01-241-8/+12
| | | | | | with multiple cache settings. Thanks to Jim Dalton for the report, and to Jim and Joshua Ginsberg for the work on the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15285 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Beefed up the tests for multi-cache handling of the cache middleware and ↵Russell Keith-Magee2010-12-221-18/+21
| | | | | | 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 #11675 -- Added support for the PyLibMC cache library. In order to ↵Russell Keith-Magee2010-12-211-8/+29
| | | | | | support this, and clean up some other 1.3 caching additions, this patch also includes some changes to the way caches are defined. This means you can now have multiple caches, in the same way you have multiple databases. A huge thanks to Jacob Burch for the work on the PyLibMC backend, and to Jannis for his work on the cache definition changes. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15005 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #14560 -- Enable HEAD requests to be cached properly. Thanks, codemonkey!Honza Král2010-10-291-9/+12
| | | | | | | | 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
* Fixed #9221 -- Small optimisation to caching middleware handling.Malcolm Tredinnick2008-09-301-2/+3
| | | | | | | | In the slightly unusual case that CACHE_MIDDLEWARE_SECONDS is set to 0, don't bother storing a copy in the local cache. git-svn-id: http://code.djangoproject.com/svn/django/trunk@9098 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed a typo and added a bit more ReST markup to cache middleware docstring.Gary Wilson Jr2008-08-151-10/+10
| | | | git-svn-id: http://code.djangoproject.com/svn/django/trunk@8387 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Split CacheMiddleware up into two parts -- an update-cache and a ↵Jacob Kaplan-Moss2008-08-091-57/+115
| | | | | | | | | | | fetch-from-cache middleware. This lets you run each half of the cache middleware at the correct time to avoid bad interactions between the cache middleware and other middleware that must modify the cache key (like the locale middleware). CacheMiddleware itself is still around for backwards-compatibility and as a hook point for the cache decorator, but the documentation has been updated to point people towards the two-part caching middleware. Refs #730. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8260 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #5813 -- Taught the CacheMiddleware to respect any max-age HTTP headerMalcolm Tredinnick2007-11-291-5/+18
| | | | | | | when setting the expiry time. Thanks, SmileyChris. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6736 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #3808 -- Fixed some typos in comments. Thanks, Collin GradyAdrian Holovaty2007-03-251-1/+1
| | | | git-svn-id: http://code.djangoproject.com/svn/django/trunk@4816 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #2541 -- Added helpful error message for CacheMiddleware in the case ↵Adrian Holovaty2006-08-181-0/+3
| | | | | | of CACHE_ANONYMOUS_ONLY=True and uninstalled/unordered AuthenticationMiddleware. Thanks, dummy@habmalnefrage.de git-svn-id: http://code.djangoproject.com/svn/django/trunk@3603 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Second half of little cleanup tweaks suggested by pyflakes.Jacob Kaplan-Moss2006-07-211-1/+0
| | | | git-svn-id: http://code.djangoproject.com/svn/django/trunk@3414 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #2392 -- Fixed CACHE_MIDDLEWARE_ANONYMOUS_ONLY to use attribute access ↵Adrian Holovaty2006-07-211-1/+1
| | | | | | to django.conf.settings git-svn-id: http://code.djangoproject.com/svn/django/trunk@3406 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Small style fixes to docs from [3395]Adrian Holovaty2006-07-201-1/+1
| | | | git-svn-id: http://code.djangoproject.com/svn/django/trunk@3397 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Oops, fixed small typo in [3395]Jacob Kaplan-Moss2006-07-201-1/+1
| | | | git-svn-id: http://code.djangoproject.com/svn/django/trunk@3396 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Added a CACHE_MIDDLEWARE_ANONYMOUS_ONLY setting which makes the cache ignore ↵Jacob Kaplan-Moss2006-07-201-1/+14
| | | | | | | | | pages served to authenticated users. Fixes #1509 (thanks, Matt). Also added a FAQ entry about using this setting to avoid caching of the admin interface. git-svn-id: http://code.djangoproject.com/svn/django/trunk@3395 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Converted request.META['REQUEST_METHOD'] calls to request.method, throughout ↵Adrian Holovaty2006-06-201-2/+2
| | | | | | the Django codebase git-svn-id: http://code.djangoproject.com/svn/django/trunk@3171 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #2109 -- Convert old-style classes to new-style classes throughout ↵Adrian Holovaty2006-06-081-1/+1
| | | | | | Django. Thanks, Nicola Larosa git-svn-id: http://code.djangoproject.com/svn/django/trunk@3113 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* MERGED MAGIC-REMOVAL BRANCH TO TRUNK. This change is highly ↵Adrian Holovaty2006-05-021-1/+1
| | | | | | 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 #647 -- Fixed cache middleware not to expect _cache_update_cache, in ↵Adrian Holovaty2005-10-191-1/+1
| | | | | | case of 404s and 500s. Thanks, Eugene git-svn-id: http://code.djangoproject.com/svn/django/trunk@954 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #599 -- locmem cache now uses deepcopy() to prevent aliasing. Thanks, HugoAdrian Holovaty2005-10-101-2/+1
| | | | git-svn-id: http://code.djangoproject.com/svn/django/trunk@821 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #580 -- Added mega support for generating Vary headers, including some ↵Adrian Holovaty2005-10-091-67/+49
| | | | | | view decorators, and changed the CacheMiddleware to account for the Vary header. Also added GZipMiddleware and ConditionalGetMiddleware, which are no longer handled by CacheMiddleware itself. Also updated the cache.txt and middleware.txt docs. Thanks to Hugo and Sune for the excellent patches git-svn-id: http://code.djangoproject.com/svn/django/trunk@810 bcc190cf-cafb-0310-a4f2-bffc1f526a37