Home Rails Cache - ASCII characters showing up?
Reply: 1

Rails Cache - ASCII characters showing up?

Sixers17
1#
Sixers17 Published in 2017-11-08 20:10:35Z

I'm attempting a simple Rails cache fetch and I'm getting a bunch of ascii characters as a result. I want to fetch something from the cache, if it misses, then just return an empty array.

Rails.cache.fetch('store_links') { [] }

When I run it in console as an empty array I get: [1] development ยป Rails.cache.fetch('store_links') { [] } => "\x04\b[\x00"

If it helps: This was working in Rails 3 but now failing with Rails 4.

Any information would be helpful! Thanks!

Sixers17
2#
Sixers17 Reply to 2017-11-08 20:26:21Z

I figured it out,

I added config.cache_store = :null_store in development.rb.

Interestingly enough though, in Rails 3 this line wasn't there and it was working fine, so if somebody can explain that, it'll be helpful!

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.336744 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO