write_entry(key, entry, **options) private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activesupport/lib/active_support/cache/memory_store.rb, line 158
        def write_entry(key, entry, **options)
          payload = serialize_entry(entry)
          synchronize do
            return false if options[:unless_exist] && @data.key?(key)

            old_payload = @data[key]
            if old_payload
              @cache_size -= (old_payload.bytesize - payload.bytesize)
            else
              @cache_size += cached_size(key, payload)
            end
            @data[key] = payload
            prune(@max_size * 0.75, @max_prune_time) if @cache_size > @max_size
            true
          end
        end
Register or log in to add new notes.