Sha256: 7a5134616c624e0bcd9eb1755e9ab4f6c31e58cf8915f1d876bd2a497e48d419

Contents?: true

Size: 463 Bytes

Versions: 1

Compression:

Stored size: 463 Bytes

Contents

module Isomorfeus
  module Professional
    class RedisComponentCache
      def initialize(*args)
        @redis_client = Redis.new(@args)
      end

      def fetch(key)
        json = @redis_client.get(key)
        Oj.load(json, mode: :strict)
      end

      def store(key, rendered_tree, response_status, styles)
        json = Oj.dump([rendered_tree, response_status, styles], mode: :strict)
        @redis_client.set(key, json)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
isomorfeus-react-16.13.11 lib/isomorfeus/react/redis_component_cache.rb