instance method should_compress?

Ruby on Rails 3.0.20

Since v3.0.20 Last seen in v3.2.22.5 Private

Available in: v3.0.20 v3.1.12 v3.2.22.5

Signature

should_compress?(value, options)

No documentation comment.

Parameters

value req
options req
Source
# File activesupport/lib/active_support/cache.rb, line 626
        def should_compress?(value, options)
          if options[:compress] && value
            unless value.is_a?(Numeric)
              compress_threshold = options[:compress_threshold] || DEFAULT_COMPRESS_LIMIT
              serialized_value = value.is_a?(String) ? value : Marshal.dump(value)
              return true if serialized_value.size >= compress_threshold
            end
          end
          false
        end

Defined in activesupport/lib/active_support/cache.rb line 626 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveSupport::Cache::Entry

Type at least 2 characters to search.

↑↓ navigate · open · esc close