Closed casperisfine closed 3 years ago
Not all AS::Cache backends are capable of reading raw values without being told specifically to do so, for instance Rails 6.1 RedisCacheStore:
RedisCacheStore
>> cache = ActiveSupport::Cache::RedisCacheStore.new => #<ActiveSupport::Cache::RedisCacheStore options={:namespace=>nil, :compress=>true, :compress_threshold=>1024, :expires_in=>nil, :race_condition_ttl=>nil} redis={}> >> cache.write('foo', 'bar', raw: true) => "OK" >> cache.read('foo') activesupport-6.1.4/lib/active_support/core_ext/marshal.rb:8:in `load': incompatible marshal file format (can't be read) (TypeError)
So it's preferable to read with raw: true.
raw: true
Not all AS::Cache backends are capable of reading raw values without being told specifically to do so, for instance Rails 6.1
RedisCacheStore
:So it's preferable to read with
raw: true
.