Code Monkey home page Code Monkey logo

Comments (9)

wsf1990 avatar wsf1990 commented on August 26, 2024

I found that when you call the method b with _refresh,you must not use the position parameter name.

from django-cache-memoize.

akx avatar akx commented on August 26, 2024

Your example doesn't have any function decorated with @cache_memoize()...

from django-cache-memoize.

wsf1990 avatar wsf1990 commented on August 26, 2024

I'm sorry,it's my mistake.

from django-cache-memoize.

wsf1990 avatar wsf1990 commented on August 26, 2024

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.

wsf1990 avatar wsf1990 commented on August 26, 2024

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.

peterbe avatar peterbe commented on August 26, 2024

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.

peterbe avatar peterbe commented on August 26, 2024

But I also want to what can I do to practice this.

Practice? Can you try to phrase yourself differently?

from django-cache-memoize.

wsf1990 avatar wsf1990 commented on August 26, 2024

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.

akx avatar akx commented on August 26, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.