You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I ran into an issue where any calls to FastAPICache.clear(key="value") would not work for any given value passed to key. It turns out that even if you don't pass a namespace to the clear function, if you have initialized the connection with a prefix, that prefix is then used to create a namespace:
That namespace is then passed along with the key to the Redis clear function, where it supersedes the key that you explicitly are trying to clear, and the clear function is run on the prefix-generated namespace instead.
For my purposes it was simple enough to just drop the prefix altogether, but logically initializing the connection with a prefix shouldn't render clearing by key unusable like it is now.
The text was updated successfully, but these errors were encountered:
Hi, I ran into an issue where any calls to
FastAPICache.clear(key="value")
would not work for any given value passed to key. It turns out that even if you don't pass a namespace to the clear function, if you have initialized the connection with a prefix, that prefix is then used to create a namespace:fastapi-cache/fastapi_cache/__init__.py
Line 102 in 157a913
That namespace is then passed along with the key to the Redis clear function, where it supersedes the key that you explicitly are trying to clear, and the clear function is run on the prefix-generated namespace instead.
For my purposes it was simple enough to just drop the prefix altogether, but logically initializing the connection with a prefix shouldn't render clearing by key unusable like it is now.
The text was updated successfully, but these errors were encountered: