Multiple log entries when using Rails.cache

I’ve started using Rails.cache, specially Rails.cache.fetch. This gives
me some log entries I’m a little curious about - I hope someone can poke
me in the right direction.

Examples:

Rails.cache.write(‘testing’, ‘test value’)
Rails.cache.read(‘testing’)

Gives these log entries:

Cache write: testing
Cache write: testing
Cache read: testing
( Why the two writes? )

Rails.cache.fetch(‘testing’) { ‘test value’ }

Gives these log entries:

Cache read: testing
Cache write: testing
Cache miss: testing ({})
Cache write: testing
Cache write (will save 0.00ms): testing
( Miss after it is writtin? And then to extra writes? )

Best regards
Rudi

I’ve narrowed it down to situations when memcache store is used.

I think somehow the @logger_off property in active_supports cache.rb is
ignored when used with memcache?

Have anybody else experienced something similar?

Regards
Rudi

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs