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