Comments (9)
I found that when you call the method b with _refresh,you must not use the position parameter name.
from django-cache-memoize.
Your example doesn't have any function decorated with @cache_memoize()
...
from django-cache-memoize.
I'm sorry,it's my mistake.
from django-cache-memoize.
Now the question is that,When I want to clear the cache,I must call the method with _refresh=True
without positional arg name,like this:
self.b('', None, _refresh=True)
if call this method with positional arg name, the clear will not work.Like this:
self.b(arg1='', arg2=None, _refresh=True)
from django-cache-memoize.
And how can I clear a function's cache by all args?Like function b's arg1 equals 1,2,3,4,and so on, and arg2 equals '1', '2', and so on.
Since you had said that at readme:
There is no way to clear more than one cache key. In the above example, you had to know the "original arguments" when you wanted to invalidate the cache. There is no method "search" for all cache keys that match a certain pattern.
But I also want to what can I do to practice this.
from django-cache-memoize.
if call this method with positional arg name, the clear will not work
Correct. The invalidation signature needs to the exact same way as the non-invalidation signature.
from django-cache-memoize.
But I also want to what can I do to practice this.
Practice? Can you try to phrase yourself differently?
from django-cache-memoize.
I'm sorry.What I mean is that how can I clear all cache of a function.Do you have any advise?
from django-cache-memoize.
With the current implementation, there's no way to clear all cache for a function, unless you specify a custom prefix
and change it every time you need to clear the cache.
from django-cache-memoize.
Related Issues (20)
- invalidate_cache doesn't work in 0.1.4 release
- tox runs no tests
- Drop python 2.7 support HOT 3
- Why not kwargs_rewrite? HOT 7
- clear cache in different processing HOT 8
- Arguments containing colons can be mis-cached
- How to know the cache key of a cached function? HOT 3
- Automatically (with help) invalidate cache when code changes HOT 5
- Add a license HOT 2
- Issue new release on pypi HOT 2
- Feature Request: extra key components HOT 2
- Release the package with Django 3.2 support HOT 2
- Incomplete sdist
- Invalidate cache for a given function HOT 1
- Caching result only if not None.
- Add support for Django 4.0 HOT 5
- Also tag releases on Git
- Pickle error unsupported
- Please update changelog for new releases HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-cache-memoize.