add() & set()

howard chen howachen at gmail.com
Tue Oct 24 03:34:49 UTC 2006


On 10/24/06, Brad Fitzpatrick <brad at danga.com> wrote:
> Same speed.
>
> Use whichever's appropriate for your needs.
>
>
> On Tue, 24 Oct 2006, howard chen wrote:
>
> > hi,
> >
> > from the web:
> >
> > set -- unconditionally sets a given key with a given value
> > (update_foo() should use this)
> > add -- adds to the cache, only if it doesn't already exist (get_foo()
> > should use this)
> >
> >
> > is that add() is faster than set() ?
> >
> > since in most case, set() is enough, even for get_foo()
> >
> > thanks.
> >
> >
>

becoz is was a little bit confusing on the web page:
http://www.danga.com/memcached/


add -- adds to the cache, only if it doesn't already exist (get_foo()
should use this)

but the perl example above, sub get_foo_object , is using set()

thanks anyway...


More information about the memcached mailing list