4 ms·
If you're using Readthis[0] for Redis caching you can use an alternate marshaller to avoid the size and performance overhead of marshalling all objects through
by pselbert 11y ago
If you're using Readthis[0] for Redis caching you can use an alternate marshaller to avoid the size and performance overhead of marshalling all objects through Ruby. If you aren't using Readthis you really should, it's faster than RedisStore, more customizable, and actually maintained!
Mandatory disclaimer, I wrote the gem.
0: https://github.com/sorentwo/readthis https://github.com/sorentwo/readthis
- nateberkopec 11y agoOh man, this is great! I'll try to add you in to the Redis benchmarks in this post, or at least talk about using you instead of redis-store. I was very frustrated with the state of redis-store when writing this post.
- blizkreeg 11y agoDoes marshaling pose a problem (leading to cache flushes) when you upgrade to a new Ruby version?
- pselbert 11y agoNo, that hasn't posed a problem in my experience. Note that all of the stores rely on Ruby marshalling underneath. To my knowledge Readthis is the only cache that lets you choose something else like pass through, JSON, Oj, etc. You will definitely have to flush before switching from no compression to compression or changing marshallers though.
- sandGorgon 11y agoI wrote a small snippet to share cache (particularly session) between a php webapp and rails using Dalli long back. It might be completely broken by now, but worked brilliantly back then. it was based roughly on this https://gist.github.com/watsonbox/3170415 https://gist.github.com/watsonbox/3170415
- pselbert 11y agoThat sounds like a job for phuby! https://github.com/tenderlove/phuby https://github.com/tenderlove/phuby No, not really.