diff --git a/lib/cached_resource/caching.rb b/lib/cached_resource/caching.rb index 72fe75d..a0eb457 100644 --- a/lib/cached_resource/caching.rb +++ b/lib/cached_resource/caching.rb @@ -112,7 +112,10 @@ def cache_clear # Generate the request cache key. def cache_key(*arguments) - "#{name.parameterize.gsub("-", "/")}/#{arguments.join('/')}".downcase.delete(' ') + arguments_string = arguments.join('/') + arguments_key = arguments_string.length > 150 ? Digest::SHA2.hexdigest(arguments_string) : arguments_string + + "#{name.parameterize.gsub("-", "/")}/#{arguments_key}".downcase.delete(' ') end # Make a full duplicate of an ActiveResource record.