Closed scuml closed 3 years ago
Thanks for your interest @scuml.
If you want to add prefix to simple cache then you should do it at BaseCache
level. You will probably need to provide .get()
, .set()
and .delete()
there calling backend specific ._get()
and friends from its descendants, this will ensure you won't have discrepancy between them.
On implementation - let's not add ignore_prefix
so far. Switching back on function by function basis doesn't really look practical anyway. We may think about how it can be exposed on PrefixQuery
though, so that people will be able to opt out on config level. Don't need to go into this PR.
Also please avoid whitespace only changes, i.e. new empty newlines.
Resolves #325
Adds the prefix to all decorators, and simple caching methods. As this plugs a giant potential security issue where cache can leak between different deployments and applications, namespacing all keys is critical and should be the default behavior. I've included the ability to revert to the previous key names by adding the parameter
ignore_prefix
to the decorators and simple cache methods. This allows cache to be shared by eliminating the prefix, but only if the user explicitly requests it.