Skip to content

Instantly share code, notes, and snippets.

@jjb
Created November 2, 2021 00:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jjb/dac1763d888e3f837ff31e011a026def to your computer and use it in GitHub Desktop.
Save jjb/dac1763d888e3f837ff31e011a026def to your computer and use it in GitHub Desktop.
How to work with raw compressed cache data in Rails
raw = Rails.cache.redis.get( Rails.cache.redis.keys.first)
Marshal.load raw
Marshal.load(raw).instance_variable_get :@value
Zlib::Inflate.inflate Marshal.load(raw).instance_variable_get :@value
Marshal.load Zlib::Inflate.inflate Marshal.load(raw).instance_variable_get :@value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment