method
should_compress?
v4.2.7 -
Show latest stable
- Class:
ActiveSupport::Cache::Entry
should_compress?(value, options)private
No documentation available.
# File activesupport/lib/active_support/cache.rb, line 673
def should_compress?(value, options)
if value && options[:compress]
compress_threshold = options[:compress_threshold] || DEFAULT_COMPRESS_LIMIT
serialized_value_size = (value.is_a?(String) ? value : Marshal.dump(value)).bytesize
return true if serialized_value_size >= compress_threshold
end
false
end