Skip to content

Instantly share code, notes, and snippets.

@tsmango
Created June 25, 2009 14:48
Show Gist options
  • Save tsmango/135906 to your computer and use it in GitHub Desktop.
Save tsmango/135906 to your computer and use it in GitHub Desktop.
>> Rails.cache.write('test-counter', 1)
=> true
>> Rails.cache.read('test-counter')
=> 1
>> Rails.cache.read('test-counter')
=> 1
>> Rails.cache.read('test-counter')
=> 1
>> Rails.cache.read('test-counter')
=> 1
>> Rails.cache.increment('test-counter')
=> 1
>> Rails.cache.read('test-counter')
=> nil
>> Rails.cache.increment('test-counter')
=> 2
>> Rails.cache.read('test-counter')
=> nil
>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment