grape-rails-cache
grape-rails-cache copied to clipboard
Force encoding as ascii-8bit before storing in rails cache
When raw: true is set in Rails cache options, Rails expects a binary string as an input. No conversion is performed before sending the block result to the cache storage back-end.
When using the Redis/redis_cache_store as Rails.cache store, caching breaks if the json string to be cached contains non-ascii characters, like {"name":"Obélix"} for example.
Another option could be to remove the raw: true parameter completely.