1.1.4¶no release date
1.1.3¶Released: Thu May 20 2021
1.1.2¶Released: Tue Jan 26 2021
Added new region method
CacheRegion.key_is_locked(). Returns True if the given key is subject to the dogpile lock, which would indicate that the generator function is running at that time. Pull request courtesy Bastien Gerard.
Added support for the pymemcache backend, using the
"dogpile.cache.pymemcache"backend identifier. Pull request courtesy Moisés Guimarães de Medeiros.
1.1.1¶Released: Mon Nov 23 2020
1.1.0¶Released: Sun Nov 15 2020
Reworked the means by which values are serialized and deserialized from backends, and provided for custom serialization of values. Added the
CacheRegion.deserializerparameters which may be set to any serializer.
Serialization and deserialization now take place within the
CacheRegionso that backends may now assume string values in all cases. This simplifies the existing backends and also makes custom backends easier to write and maintain.
Additionally, the serializer is now applied to the user-defined value portion of the
CachedValueand not to the metadata or other portions of
CachedValueobject itself, so the serialized portion is effectively a “payload” within the larger
CachedValuestructure that is passed as part of the larger string format. The overall format is a separate JSON of the cached value metadata, followed by the serialized form. This allows for end-user serialization schemes that are hardwired to the values themselves without the need to serialize dogpile’s internal structures as well.
Existing custom backends should continue to work without issue; they now have the option to forego any separate serialization steps, and can also subclass a new backend
BytesBackendthat marks them as a backend that only deals with bytes coming in and out; all internal serialization logic from such a backend can be removed.
Pull request courtesy Alessio Bogon.
Added pep-484 annotations to most of the dogpile.cache package.
1.0.2¶Released: Fri Aug 7 2020
Added support for TLS connections to the bmemcached backend. Pull request courtesy Moisés Guimarães de Medeiros.
Repaired the setup.cfg file so that the source and wheel distributions will not add the “tests” directory to the Python environment. Pull request courtesy Michał Górny.
1.0.1¶Released: Tue Jul 21 2020
dogpile.cache 1.0.0 was released with a minimum Python version of 3.5. However, due to a dependency issue, the minimum version is now Python 3.6. The 1.0.0 release will be removed from PyPI so that Python versions prior to 3.6 will continue to make use of the previous dogpile.cache 0.9.2.
Removed the “universal=1” directive from setup.cfg as this would create py2/py3 wheels. dogpile 1.0.x is Python 3 only so a py3-only wheel is now created.
1.0.0¶Released: Sun Jul 19 2020
For version 1.0.0, dogpile.cache now supports Python 3.5 and above only.
0.9.2¶Released: Mon May 4 2020
Ensured that the “pyproject.toml” file is not included in builds, as the presence of this file indicates to pip that a pep-517 installation process should be used. As this mode of operation appears to be not well supported by current tools / distros, these problems are avoided within the scope of dogpile.cache installation by omitting the file.
0.9.1¶Released: Wed Apr 29 2020
decoratormodule as a required testing dependency to
tox.iniso that tests work when this is not pre-installed.
Added option to the Redis backend
RedisBackend.thread_local_lock, which when set to False will disable the use of a threading local by the
redismodule in its distributed lock service, which is known to interfere with the lock’s behavior when used in an “async” use case, within dogpile this would be when using the
CacheRegion.async_creation_runnerfeature. The default is conservatively being left at True, but it’s likely this should be set to False in all cases, so a warning is emitted if this flag is not set to False in conjunction with the distributed lock. Added an optional argument to
RedisBackendthat specifies whether or not a thread-local Redis lock should be used. This is the default, but it breaks asynchronous runner compatibility.
0.9.0¶Released: Mon Oct 28 2019
0.8.0¶Released: Fri Sep 20 2019
Removed the “python setup.py test” feature in favor of a straight run of “tox”. Per Pypa / pytest developers, “setup.py” commands are in general headed towards deprecation in favor of tox. The tox.ini script has been updated such that running “tox” with no arguments will perform a single run of the test suite against the default installed Python interpreter.
Replaced the Python compatbility routines for
getfullargspec()with a fully vendored version from Python 3.3. Originally, Python was emitting deprecation warnings for this function in Python 3.8 alphas. While this change was reverted, it was observed that Python 3 implementations for
getfullargspec()are an order of magnitude slower as of the 3.4 series where it was rewritten against
Signature. While Python plans to improve upon this situation, SQLAlchemy projects for now are using a simple replacement to avoid any future issues.
Pinned minimum version of Python decorator module at 4.0.0 (July, 2015) as previous versions don’t provide the API that dogpile is using.
sha1_mangle_key()key mangler to coerce incoming Unicode objects into bytes as is required by the Py3k version of this function.
0.7.1¶Released: Tue Dec 11 2018
Fixed regression in 0.7.0 caused by #136 where the assumed arguments for the
CacheRegion.async_creation_runnerexpanded to include the new
CacheRegion.get_or_create.creator_argsparameter, as it was not tested that the async runner would be implicitly called with these arguments when the
CacheRegion.cache_on_arguments()decorator was used. The exact signature of
async_creation_runneris now restored to have the same arguments in all cases.
0.7.0¶Released: Mon Dec 10 2018
decoratormodule is now used when creating function decorators within
CacheRegion.cache_multi_on_arguments()so that function signatures are preserved. Pull request courtesy ankitpatel96.
Additionally adds a small performance enhancement which is to avoid internally creating a
@wraps()decorator for the creator function on every get operation, by allowing the arguments to the creator be passed separately to
Fixed all Python 3.x deprecation warnings including
0.6.8¶Released: Sat Nov 24 2018
Project hosting has moved to GitHub, under the SQLAlchemy organization at https://github.com/sqlalchemy/dogpile.cache
0.6.7¶Released: Thu Jul 26 2018
Fixed issue in the
CacheRegion.get_or_create_multi()method which was erroneously considering the cached value as the timestamp field if the
CacheRegion.invalidate()method had ben used, usually causing a
TypeErrorto occur, or in less frequent cases an invalid result for whether or not the cached value was invalid, leading to excessive caching or regeneration. The issue was a regression caused by an implementation issue in the pluggable invalidation feature added in #38.
0.6.6¶Released: Wed Jun 27 2018
0.6.5¶Released: Mon Mar 5 2018
0.6.4¶Released: Mon Jun 26, 2017
Region.get_or_create_multi()will not pass to the cache backend if no values are ultimately to be stored, based on the use of the
Region.get_or_create_multi.should_cache_fnfunction. This empty dictionary is unnecessary and can cause API problems for backends like that of Redis. Pull request courtesy Tobias Sauerwein.
api.NO_VALUEconstant now has a fixed
__repr__()output, so that scenarios where this constant’s string value ends up being used as a cache key do not create multiple values. Pull request courtesy Paul Brown.
A new exception class
exception.PluginNotFoundis now raised when a particular cache plugin class cannot be located either as a setuptools entrypoint or as a registered backend. Previously, a plain
Exceptionwas thrown. Pull request courtesy Jamie Lennox.
0.6.3¶Released: Thu May 18, 2017
0.6.2¶Released: Tue Aug 16 2016
Added a new system to allow custom plugins specific to the issue of “invalidate the entire region”, using a new base class
RegionInvalidationStrategy. As there are many potential strategies to this (special backend function, storing special keys, etc.) the mechanism for both soft and hard invalidation is now customizable. New approaches to region invalidation can be contributed as documented recipes. Pull request courtesy Alexander Makarov.
Added a new cache key generator
kwarg_function_key_generator(), which takes keyword arguments as well as positional arguments into account when forming the cache key.
Restored some more util symbols that users may have been relying upon (although these were not necessarily intended as user-facing):
0.6.1¶Released: Mon Jun 6 2016
0.6.0¶Released: Mon Jun 6 2016
dogpile.corelibrary has been rolled in as part of the
dogpile.cachedistribution. The configuration of the
dogpilename as a namespace package is also removed from
dogpile.cache. In order to allow existing installations of
dogpile.coreas a separate package to remain unaffected, the
.corepackage has been retired within
Lockclass is now available directly as
dogpile.Lockand the additional
dogpile.coreconstructs are under the
Additionally, the long-deprecated
dogpile.core.SyncReaderDogpileclasses have been removed.
The Redis backend now creates a copy of the “arguments” dictionary passed to it, before popping values out of it. This prevents the given dictionary from losing its keys.
Fixed bug in “null” backend where
NullLockdid not accept a flag for the
NullLock.acquire()method, nor did it return a boolean value for “success”.
0.5.7¶Released: Mon Oct 19 2015
Added new parameter
GenericMemcachedBackend.lock_timeout, used in conjunction with
GenericMemcachedBackend.distributed_lock, will specify the timeout used when communicating to the
.add()method of the memcached client. Pull request courtesy Frits Stegmann and Morgan Fainberg.
Added a new flag
CacheRegion.configure.replace_existing_backend, allows a region to have a new backend replace an existing one. Pull request courtesy hbccbh.
Test suite now runs using py.test. Pull request courtesy John Anderson.
References: pull request 33
0.5.6¶Released: Mon Feb 2 2015
0.5.5¶Released: Wed Jan 21 2015
Added new arguments
CacheRegion.cache_multi_on_arguments.function_multi_key_generatorwhich serve as per-decorator replacements for the region-wide
CacheRegion.function_multi_key_generatorparameters, respectively, so that custom key production schemes can be applied on a per-function basis within one region. Pull request courtesy Hongbin Lu.
References: pull request 26
Fixed bug where sending -1 for the
CacheRegion.get_or_create_multi()would fail to honor the setting as “no expiration time”. Pull request courtesy Hongbin Lu.
wrapargument is now propagated when calling
CacheRegion.configure_from_config(). Pull request courtesy Jonathan Vanasco.
Fixed tests under py.test, which were importing a symbol from pytest itself
is_unittestwhich has been removed.
0.5.4¶Released: Sat Jun 14 2014
NullBackend, for testing and cache-disabling purposes. Pull request courtesy Wichert Akkerman.
References: pull request 18
RedisBackend.connection_pooloption on the Redis backend; this can be passed a
redis.ConnectionPoolinstance directly. Pull request courtesy Masayuko.
References: pull request 17
RedisBackend.socket_timeoutoption on the Redis backend. Pull request courtesy Saulius Menkevičius.
References: pull request 16
Added support for tests to run via py.test.
Added missing Mako test dependency to setup.py. Pull request courtesy Wichert Akkerman.
References: pull request 19
Repaired the entry point for Mako templates; the name of the entrypoint itself was wrong vs. what was in the docs, but beyond that the entrypoint would load the wrong module name. Pull request courtesy zoomorph.
References: pull request 15
coerce_string_conf()function, which is used by
Region.configure_from_config(), will now recognize floating point values when parsing conf strings and deliver them as such; this supports non-integer values such as Redis
lock_sleep. Pullreq courtesy Jeff Dairiki.
0.5.3¶Released: Wed Jan 8 2014
get()method to complement the
refresh()methods established on functions decorated by
CacheRegion.cache_multi_on_arguments(). Pullreq courtesy Eric Hanchrow.
Added a new variant on
MemoryPickleBackend. This backend applies
pickle.loads()to cached values upon set and get, so that similar copy-on-cache behavior as that of other backends is employed, guarding cached values against subsequent in-memory state changes. Pullreq courtesy Jonathan Vanasco.
Fixed bug where the key_mangler would get in the way of usage of the async_creation_runner feature within the
Region.get_or_create()method, by sending in the mangled key instead of the original key. The “mangled” key is only supposed to be exposed within the backend storage, not the creation function which sends the key back into the
Region.set(), which does the mangling itself. Pull request courtesy Ryan Kolak.
References: pull request 10
Fixed bug where the
Region.get_multi()method wasn’t calling the backend correctly in Py3K (e.g. was passing a destructive
map()object) which would cause this method to fail on the memcached backend.
Fixed a format call in the redis backend which would otherwise fail on Python 2.6; courtesy Jeff Dairiki.
References: pull request 9
0.5.2¶Released: Fri Nov 15 2013
Added a new argument
DBMBackendimplementation. This allows for drop-in replacement of the default
FileLockbackend, which builds on
os.flock()and only supports Unix platforms. A new abstract base
AbstractFileLockhas been added to provide a common base for custom lock implementations. The documentation points to an example thread-based rw lock which is now tested on Windows.
Fixes to routines on Windows, including that default unit tests pass, and an adjustment to the “soft expiration” feature to ensure the expiration works given windows time.time() behavior.
Added py2.6 compatibility for unsupported
total_seconds()call in region.py
0.5.1¶Released: Thu Oct 10 2013
CacheRegion.invalidate()method now supports an option
hard=True|False. A “hard” invalidation, equivalent to the existing functionality of
CacheRegion.get_or_create()will not return the “old” value at all, forcing all getters to regenerate or wait for a regeneration. “soft” invalidation means that getters can continue to return the old value until a new one is generated.
New dogpile-specific exception classes have been added, so that issues like “region already configured”, “region unconfigured”, raise dogpile-specific exceptions. Other exception classes have been made more specific. Also added new accessor
CacheRegion.is_configured. Pullreq courtesy Morgan Fainberg.
Erroneously missed when the same change was made for
set()in 0.5.0, the Redis backend now uses
set_multi()method as well when producing pickles. Courtesy Łukasz Fidosz.
Fixed an errant
u''causing incompatibility in Python3.2 in the Redis backend, courtesy Jimmey Mabey.
util.coerce_string_conf()method now correctly coerces negative integers and those with a leading + sign. This previously prevented configuring a
'-1'. Courtesy David Beitey.
CacheRegion.cache_multi_on_arguments()now supports the
0.5.0¶Released: Fri Jun 21 2013
Now using the
Lockincluded with the Python
redisbackend, which adds
lock_sleeparguments to the
Added new methods
CacheRegion.cache_multi_on_arguments(), which make use of the
CacheRegion.get_multi()and similar functions to store and retrieve multiple keys at once while maintaining dogpile semantics for each.
CacheRegion.configure()accepts an optional
datetime.timedeltaobject for the
expiration_timeargument as well as an integer, courtesy Jack Lutz.
expiration_timeargument passed to
CacheRegion.cache_on_arguments()may be a callable, to return a dynamic timeout value. Courtesy David Beitey.
Added support for simple augmentation of existing backends using the
ProxyBackendclass. Thanks to Tim Hanus for the great effort with development, testing, and documentation.
References: pull request 14
The Redis backend now uses
pickle.HIGHEST_PROTOCOLwhen producing pickles. Courtesy Lx Yu.
CacheRegion.cache_on_arguments()now has a new argument
to_str, defaults to
str(). Can be replaced with
unicode()or other functions to support caching of functions that accept non-unicode arguments. Initial patch courtesy Lx Yu.
Fixed bug where the “name” parameter for
CacheRegionwas ignored entirely. Courtesy Wichert Akkerman.
Source repository has been moved to git.
0.4.3¶Released: Thu Apr 4 2013
CacheRegion.cache_on_arguments()now accept a new argument
should_cache_fn, receives the value returned by the “creator” and then returns True or False, where True means “cache plus return”, False means “return the value but don’t cache it.”
References: pull request 13
0.4.2¶Released: Sat Jan 19 2013
0.4.1¶Released: Sat Dec 15 2012
The function decorated by
CacheRegion.cache_on_arguments()now includes a
set()method, in addition to the existing
invalidate(), it accepts a set of function arguments, but additionally accepts as the first positional argument a new value to place in the cache, to take the place of that key. Courtesy Antoine Bertin.
References: pull request 9
Redis backend now accepts optional “url” argument, will be passed to the new
StrictRedis.from_url()method to determine connection info. Courtesy Jon Rosebaugh.
Redis backend now accepts optional “password” argument. Courtesy Jon Rosebaugh.
DBM backend has “fallback” when calling dbm.get() to instead use dictionary access + KeyError, in the case that the “gdbm” backend is used which does not include .get(). Courtesy Jon Rosebaugh.
Fixed bug in DBM backend whereby if an error occurred during the “write” operation, the file lock, if enabled, would not be released, thereby deadlocking the app.
util.function_key_generator()used by the function decorator no longer coerces non-unicode arguments into a Python unicode object on Python 2.x; this causes failures on backends such as DBM which on Python 2.x apparently require bytestrings. The key_mangler is still needed if actual unicode arguments are being used by the decorated function, however.
0.4.0¶Released: Tue Oct 30 2012
0.3.1¶Released: Tue Sep 25 2012
Fixed the mako_cache plugin which was not yet covered, and wasn’t implementing the mako plugin API correctly; fixed docs as well. Courtesy Ben Hayden.
Fixed setup so that the tests/* directory isn’t yanked into the install. Courtesy Ben Hayden.
0.3.0¶Released: Thu Jun 14 2012
get() method now checks expiration time by default. Use ignore_expiration=True to bypass this.
Added new invalidate() method. Sets the current timestamp as a minimum value that all retrieved values must be created after. Is honored by the get_or_create() and get() methods.
0.2.4¶no release date
Fixed py3k issue with config string coerce, courtesy Alexander Fedorov
0.2.3¶Released: Wed May 16 2012
support “min_compress_len” and “memcached_expire_time” with python-memcached backend. Tests courtesy Justin Azoff
Add support for coercion of string config values to Python objects - ints, “false”, “true”, “None”.
Added support to DBM file lock to allow reentrant access per key within a single thread, so that even though the DBM backend locks for the whole file, a creation function that calls upon a different key in the cache can still proceed.
Fixed DBM glitch where multiple readers could be serialized.
Adjust bmemcached backend to work with newly-repaired bmemcached calling API (see bmemcached ef206ed4473fec3b639e).
0.2.2¶Released: Thu Apr 19 2012
add Redis backend, courtesy Ollie Rutherfurd
0.2.1¶Released: Sun Apr 15 2012
move tests into tests/cache namespace
py3k compatibility is in-place now, no 2to3 needed.
0.2.0¶Released: Sat Apr 14 2012
Based on dogpile.core now, to get the package namespace thing worked out.
0.1.1¶Released: Tue Apr 10 2012
Fixed the configure_from_config() method of region and backend which wasn’t working. Courtesy Christian Klinger.
0.1.0¶Released: Sun Apr 08 2012
Includes a pylibmc backend and a plain dictionary backend.