I have troubles using increment, it returns nil and it doesn't update value in memcached, I can't understand if I'm wronging something or if there is a bug.
1.9.3p194 :001 > Rails.cache.read('foo')
1.9.3p194 :002 > Rails.cache.write('foo', 1)
1.9.3p194 :003 > Rails.cache.read('foo')
1.9.3p194 :004 > Rails.cache.increment('foo', 1)
1.9.3p194 :005 > Rails.cache.read('foo')
I would expect after .increment to have 'foo' = 2
I copied your commands and got the expected result. Are you still having this problem?
yes the problem is still there (I also updated to Dalli 2.5.0 but nothing changed)
I'm doing this inside rails console using rails 3.2.9 running on ruby 1.9.3p327 (if it can be useful to understand where the problem is)
You do not read or write incremented values, this is not legal in memcached. You use increment(value, 1) to increment the counter and use increment(value, 0) to read the current value.