Package: pyramid-dogpile-cache2
pyramid_dogpile_cache2Smalldogpile.cacheconfiguration and access package. It is inspired bypyramid_dogpile_cache, which we found unusable since it insists on
configuring the cache regions in itsget_region()API – but if you want to
use the@cache_on_argumentsdecorator, that is atimport time, where no
configuration exists yet. Our package wants to perform the configuration during
the WSGI application setup instead.This package is compatible with Python version >=3.6.UsageThe package offers only one API function; it returns a dogpile.cacheCacheRegion:from pyramid_dogpile_cache import get_region
region = get_region('foo')As said above, this is safe to call at import time, so you can go on like this:@region.cache_on_arguments()
def expensive_function(one, two, three):
    # compute stuffSetup / PyramidInclude the package, either in code:config = Configurator(...)
config.include('pyramid_dogpile_cache2')or in the ini file:pyramid.includes = pyramid_dogpile_cache2Setup / PasteFor non-Pyramid WSGI applications that use a paste.ini file, you need to call:def my_paste_app_factory(global_conf, **local_conf):
    pyramid_dogpile_cache2.configure_dogpile_cache(local_conf)
    return my_wsgi_callableSettingsThe settings support of pyramid_dogpile_cache unfortunately is quite incomplete
(e.g. it does not even convertexpiration_timetoint). The support of
this packages is a little better, but still very much incomplete: we support
the in-memory and memcached backends (pylibmc to be precise), and only the same
backend and configuration for all cache regions.The following settings are supported:dogpile_cache.regionsA list of region names that should be configured (separated by either
spaces or commas).dogpile_cache.backendThe default backend for cache regions (e.g.'dogpile.cache.memory',dogpile.cache.pylibmc, etc.).dogpile_cache.REGION.backendBackend for the given region.dogpile_cache.expiration_timeThe default expiration time. Can be overridden for individual regions (in
seconds). Omit to set no expiration.dogpile_cache.REGION.expiration_timeThe expiration time for the given cache region (in seconds).
If omitted, uses the global expiration_time setting.dogpile_cache.arguments.*Defaults for backend arguments. Can be overridden for individual regions.dogpile_cache.REGION.arguments.*Backend arguments for the given cache region.Backend arguments work only for strings, thus we support some custom treatment:dogpile_cache.pylibmc_urlA list of memcached servers, separated by;.dogpile_cache.pylibmc_behavior.*Setpylibmc behaviours, seecoerce_memached_behaviorsfor which
subkeys are supported.Note: As opposed to pyramid_dogpile_cache we don’t support overriding the
key_generator or key_mangler functions yet; we preconfigure them with enhanced
versions of dogpile.cache that support non-ascii function arguments and
generating cache keys for methods that include the class name.Developing pyramid_dogpile_cache2Author:Zeit OnlinePyPI page:https://pypi.python.org/pypi/pyramid_dogpile_cache2Issues:report by e-mailSource code:https://github.com/zeitonline/pyramid_dogpile_cache2Current change log:https://github.com/zeitonline/pyramid_dogpile_cache2/blob/master/CHANGES.txtChange log for pyramid_dogpile_cache21.1.2 (2022-07-15)Clear internal_actual_backendduring configure,
to improve test isolation1.1.1 (2020-09-11)Ignore emptypylibmc_urlsetting1.1.0 (2020-07-28)Drop Python-2 compatibility, update to dogpile.cache>=1.01.0.6 (2019-11-08)Allow configuring no expiration time at all1.0.5 (2018-12-14)Clarify Python-3 compatiblity (it’s >=3.4, not _just_ 3.4)1.0.4 (2018-11-21)Support caching functions with type annotations on Python 3
(see PR #5).1.0.3 (2017-02-14)Fix packaging issue (see PR #2).1.0.2 (2016-08-01)Update API compatibility to dogpile.cache-0.6.0.1.0.1 (2016-01-20)Actually include the class name in the cache key for methods.1.0.0 (2016-01-19)Initial release.