summaryrefslogtreecommitdiff
path: root/django/core/cache
Commit message (Collapse)AuthorAgeFilesLines
* Refs #33476 -- Applied Black's 2023 stable style.David Smith2023-02-011-1/+0
| | | | | | | | Black 23.1.0 is released which, as the first release of the year, introduces the 2023 stable style. This incorporates most of last year's preview style. https://github.com/psf/black/releases/tag/23.1.0
* Refs #34233 -- Used str.removeprefix()/removesuffix().Mariusz Felisiak2023-01-181-1/+1
|
* Fixed #34233 -- Dropped support for Python 3.8 and 3.9.Mariusz Felisiak2023-01-182-2/+2
|
* Fixed #34212 -- Made RedisCacheClient.incr() use write connection.Leo2022-12-161-1/+1
| | | | Co-authored-by: Sin-Woo Bang <sinwoobang@gmail.com>
* Fixed #34209 -- Prevented FileBasedCache.has_key() crash caused by a race ↵Marti Raudsepp2022-12-131-2/+3
| | | | condition.
* Fixed #33826 -- Fixed RedisCache.set_many()/delete_many() crash with an ↵Christos Kopanos2022-07-061-0/+4
| | | | empty list.
* Used list comprehensions in RedisCache.delete_many().Christos Kopanos2022-07-061-4/+1
|
* Fixed #33681 -- Made Redis client pass CACHES["OPTIONS"] to a connection pool.Mariusz Felisiak2022-05-161-2/+2
| | | Thanks Ben Picolo for the report.
* Made closing in connection handlers more DRY.Nick Pope2022-05-121-2/+1
|
* Refs #32365 -- Removed internal uses of utils.timezone.utc alias.Carlton Gibson2022-03-241-5/+5
| | | | | Remaining test case ensures that uses of the alias are mapped canonically by the migration writer.
* Prevented initialization of unused database connections.Florian Apolloner2022-03-171-8/+0
|
* Refs #33476 -- Refactored code to strictly match 88 characters line length.Mariusz Felisiak2022-02-071-1/+2
|
* Refs #33476 -- Reformatted code with Black.django-bot2022-02-077-123/+193
|
* Refs #29708 -- Stopped inheriting from PickleSerializer by RedisSerializer.Adam Johnson2022-01-131-8/+7
|
* Fixed #33361 -- Fixed Redis cache backend crash on booleans.Jeremy Lainé2021-12-141-1/+7
|
* Fixed #33340 -- Fixed unquoted column names in queries used by DatabaseCache.Arsa2021-12-091-4/+10
|
* Fixed #28401 -- Allowed hashlib.md5() calls to work with FIPS kernels.Ade Lee2021-10-122-5/+7
| | | | | | | | | | | | | | | | | | | md5 is not an approved algorithm in FIPS mode, and trying to instantiate a hashlib.md5() will fail when the system is running in FIPS mode. md5 is allowed when in a non-security context. There is a plan to add a keyword parameter (usedforsecurity) to hashlib.md5() to annotate whether or not the instance is being used in a security context. In the case where it is not, the instantiation of md5 will be allowed. See https://bugs.python.org/issue9216 for more details. Some downstream python versions already support this parameter. To support these versions, a new encapsulation of md5() has been added. This encapsulation will pass through the usedforsecurity parameter in the case where the parameter is supported, and strip it if it is not. Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
* Refs #32193 -- Removed MemcachedCache per deprecation timeline.Mariusz Felisiak2021-09-201-40/+0
|
* Fixed #33012 -- Added Redis cache backend.Daniyal2021-09-141-0/+224
| | | | | | Thanks Carlton Gibson, Chris Jerdonek, David Smith, Keryn Knight, Mariusz Felisiak, and Nick Pope for reviews and mentoring this Google Summer of Code 2021 project.
* Fixed #32076 -- Added async methods to BaseCache.Andrew-Chen-Wang2021-09-071-0/+87
| | | | This also makes DummyCache async-compatible.
* Fixed #33060 -- Added BaseCache.make_and_validate_key() hook.Nick Pope2021-09-076-84/+49
| | | | | This helper function reduces the amount of duplicated code and makes it easier to ensure that we always validate the keys.
* Refs #33060 -- Ensured cache backends validate keys.Nick Pope2021-09-071-4/+7
| | | | | | | | The validate_key() function should be called after make_key() to ensure that the validation is performed on the key that will actually be stored in the cache. Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
* Refs #33060 -- Added .make_key() in .touch() for dummy cache backend.Nick Pope2021-09-031-0/+1
| | | | All cache operations should use make_key().
* Refs #33061 -- Removed unnecessary BaseMemcachedCache.decr().Mariusz Felisiak2021-08-311-23/+7
|
* Fixed #33061 -- Fixed handling nonexistent keys with negative deltas in ↵Sondre Lillebø Gundersen2021-08-311-6/+6
| | | | | | incr()/decr() in memcached backends. Thanks Chris Jerdonek for the review.
* Fixed #32772 -- Made database cache count size once per set.Michael Lissner2021-05-261-6/+6
|
* Fixed #32747 -- Prevented initialization of unused caches.Mariusz Felisiak2021-05-181-1/+8
| | | | | | Thanks Alexander Ebral for the report. Regression in 98e05ccde440cc9b768952cc10bc8285f4924e1f.
* Fixed #32366 -- Updated datetime module usage to recommended approach.Nick Pope2021-05-121-8/+3
| | | | | | | - Replaced datetime.utcnow() with datetime.now(). - Replaced datetime.utcfromtimestamp() with datetime.fromtimestamp(). - Replaced datetime.utctimetuple() with datetime.timetuple(). - Replaced calendar.timegm() and datetime.utctimetuple() with datetime.timestamp().
* Fixed #32705 -- Prevented database cache backend from checking .rowcount on ↵ecogels2021-05-051-1/+1
| | | | | | closed cursor. Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
* Fixed #29867 -- Added support for storing None value in caches.Nick Pope2020-12-172-15/+20
| | | | | | | | | | | | Many of the cache operations make use of the default argument to the .get() operation to determine whether the key was found in the cache. The default value of the default argument is None, so this results in these operations assuming that None is not stored in the cache when it actually is. Adding a sentinel object solves this issue. Unfortunately the unmaintained python-memcached library does not support a default argument to .get(), so the previous behavior is preserved for the deprecated MemcachedCache backend.
* Fixed typo in django/core/cache/backends/base.py docstring.Abhishek Ghaskata2020-12-151-1/+1
|
* Fixed #32193 -- Deprecated MemcachedCache.Mariusz Felisiak2020-12-092-3/+9
|
* Fixed #32233 -- Cleaned-up duplicate connection functionality.Florian Apolloner2020-12-081-56/+9
|
* Refs #21012 -- Removed unnecessary _create_cache() hook.Florian Apolloner2020-12-071-27/+10
| | | | | | | | This removes unused (since d038c547b5ce585cbf9ef5bb7e5298f52e4a243b) workaround to load a cache backend with its dotted import path and moves remaining logic to the CacheHandler. Thanks Tim Graham for the review.
* Fixed #29887 -- Added a cache backend for pymemcache.Nick Pope2020-09-161-0/+14
|
* Refs #29887, Refs #24212 -- Added servers configuration hook for memcached ↵Nick Pope2020-09-021-1/+12
| | | | | | | | | backends. The servers property can be overridden to allow memcached backends to alter the server configuration prior to it being passed to instantiate the client. This allows avoidance of documentation for per-backend differences, e.g. stripping the 'unix:' prefix for pylibmc.
* Refs #29887 -- Simplified memcached client instantiation.Nick Pope2020-09-011-17/+4
|
* Fixed CVE-2020-24584 -- Fixed permission escalation in intermediate-level ↵Mariusz Felisiak2020-09-011-1/+7
| | | | directories of the file system cache on Python 3.7+.
* Fixed #31907 -- Fixed missing validate_key() calls in cache backends.Nick Pope2020-08-242-1/+9
|
* Refs #29887, #27480 -- Moved touch() to BaseMemcachedCache.Nick Pope2020-08-201-4/+4
|
* Fixed comments related to nonexistent keys for incr()/decr() in memcached ↵Nick Pope2020-08-201-12/+8
| | | | backends.
* Fixed #31728 -- Fixed cache culling when no key is found for deletion.Guillermo Bonvehí2020-06-221-3/+6
| | | | | | DatabaseCache._cull implementation could fail if no key was found to perform a deletion in the table. This prevented the new cache key/value from being correctly added.
* Fixed #31654 -- Fixed cache key validation messages.Mariusz Felisiak2020-06-051-1/+1
|
* Fixed CVE-2020-13254 -- Enforced cache key validation in memcached backends.Dan Palmer2020-06-033-15/+39
|
* Fixed #31253 -- Fixed data loss possibility when using caching from async code.Jon Dufresne2020-02-111-2/+2
| | | | Case missed in a415ce70bef6d91036b00dd2c8544aed7aeeaaed.
* Fixed #30759 -- Made cache.delete() return whether it succeeded.daniel a rios2019-11-146-9/+22
| | | | Thanks Simon Charette for the review.
* Fixed #30772 -- Optimized make_template_fragment_key().Daniel Fairhead2019-09-181-6/+6
| | | | | Removed usage of urllib.quote(), unnecessary since cbbe60c7fc39fa8ff75554bd90104eaad6924bb1. Used hasher's .update() on key fragments.
* Removed unnecessary assignments in various code.Jon Dufresne2019-04-241-2/+1
|
* Fixed #30181 -- Made cache.get() with default work correctly on PyLibMCCache ↵Jakub Szafrański2019-02-141-4/+11
| | | | if None is cached.
* Simplified FileBasedCache.clear().Jon Dufresne2019-02-081-7/+4
| | | glob.glob1() ignores missing paths.