A cache backend that forwards to other dynamically-configured backends.
ForwardingCacheBackend(cache_name=u'forwarded_backend', *args, **kwargs)¶
Forwards requests to another cache backend.
This is used to allow for dynamic configuration of caches that can be swapped in and out. By setting this cache backend as the default backend, the consumer can easily switch between other cache backends without modifying
settings.pyand restarting the app.
This by default looks for another cache backend in
settings.CACHES['forwarded_backend']. This can be changed with the
LOCATIONsetting for this cache backend. All requests and attribute lookups will be forwarded there.
If a consumer switches the real cache backend, it can call
reset_backend(), and all future cache requests will go to the newly computed backend.
__init__(cache_name=u'forwarded_backend', *args, **kwargs)¶
x.__init__(…) initializes x; see help(type(x)) for signature
Return the forwarded cache backend.
Reset the forwarded cache backend.
This must be called after modifying
settings.CACHES['forwarded_backend']in order for the new backend to be picked up.
Close the cache backend.
x.__getattribute__(‘name’) <==> x.name