Skip to content

Instantly share code, notes, and snippets.

@mb-dev
Created February 22, 2013 18:58
Show Gist options
  • Select an option

  • Save mb-dev/5015716 to your computer and use it in GitHub Desktop.

Select an option

Save mb-dev/5015716 to your computer and use it in GitHub Desktop.
Dogpile Effect - key
def custom_write_dogpile(name, timestamp, fragment, options)
Rails.cache.write(timestamp_key(name, timestamp), fragment)
Rails.cache.write(name + ':last', fragment)
Rails.cache.delete(name + ':refresh-thread')
fragment
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment