Hello,

I am not quite sure if this is the right mailinglist but as long as my remarks are about a core-component of django I hopefully chose the right list.

Dealing with cache-stuff in Django I realized that it seems to be impossible to use a timeout=0 (which in terms of memcached meant that the item would never expire unless it has to make way for new items due to memory shortage). This is because even still in the most current trunk-version the timeout is calculated (in django.core.backends.memcached.CacheClass._get_memcache_timeout) as

timeout = timeout or self.default_timeout

where timeout is one of the parameters given to _get_memcache_timeout.

So as long as timeout=0 always the default_timeout will be used.
Maybe this behaviour is intended to prevent memcached being filled up with items that never expire. In my opinion it may be better to enable developers to use the timeout-values as intended by memcached (where 0 means no expiration at all).

So I would like to suggest to change the default value in all method signatures of the memcached.CacheClass (and whereever it whould be necessary) from 0 to None and to replace the line above by an if-clause as

if timeout is None:
    timeout = self.default_timeout

This is not as elegant as the original version but now it would be possible to use 0 as a timeout.

If it would help I can try to open a ticket and provide a first path against the current trunk.


With best regards

Carsten Reimer



--
Carsten Reimer
Web Developer
carsten.rei...@galileo-press.de
Phone +49.228.42150.73

Galileo Press GmbH
Rheinwerkallee 4 - 53227 Bonn - Germany
Phone +49.228.42150.0 (Zentrale) .77 (Fax)
http://www.galileo-press.de/

Managing Directors: Tomas Wehren, Ralf Kaulisch, Rainer Kaltenecker
HRB 8363 Amtsgericht Bonn

--
You received this message because you are subscribed to the Google Groups "Django 
developers" group.
To post to this group, send email to django-develop...@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to