On Tue, May 6, 2014 at 4:16 AM, Piotr Gosławski
<piotr.goslaw...@gmail.com>wrote:

> Hi!
>
> Since the contribution workflow is a bit confusing to me, I'll just leave
> it here.
> I think django's cache needs ttl (time to live) method that would return
> time left until specified key expires. I, for instance, needed one when
> writing
> a rate limiter. Without it I would have to store twice as much key-value
> pairs
> in cache. I ended up with a workaround that dynamically binds ttl method,
> but only for locmem and redis, since those are the backends I use.
>
> Here is my workoround, maybe it will be of some use:
> https://github.com/p-tr0/snipets/blob/master/django_cache_ttl.py
>
> I guess the proper way would be to add a method that just raises
> NotImplementedError and then cover it one backend at a time.
>

Hi Piotr,

Sounds like a reasonable proposal to me. Feel free to open a ticket, and
maybe try your hand at writing a patch!

As far as the NotImplemented bit goes - I'd rather see this implemented for
all officially supported backends, rather than only one backend. The only
exception to this would be if there is a fundamental technical reason why
TTL can't be implemented (or adequately faked).

Yours
Russ Magee %-)

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAJxq84__RVS7gNC3bXnCTM6689XjMygZn%3D-%2BU00Gka0fr0ErMQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to