Skip to content

Instantly share code, notes, and snippets.

@nickboyce
Created January 30, 2014 16:18
Show Gist options
  • Save nickboyce/8712280 to your computer and use it in GitHub Desktop.
Save nickboyce/8712280 to your computer and use it in GitHub Desktop.
module ActiveSupport
module Cache
class IronCache < ActiveSupport::Cache::Store
def escape_key(key)
ekey = ::Base64.encode64(key).gsub("\n",'').gsub("/",'')
if ekey.size > 250
ekey = "#{ekey[0, 213]}:md5:#{Digest::MD5.hexdigest(ekey)}"
end
ekey
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment