Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force encoding as ascii-8bit before storing in rails cache #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

misdoro
Copy link

@misdoro misdoro commented Nov 6, 2019

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.

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.
@misdoro
Copy link
Author

misdoro commented Nov 6, 2019

Another option could be to remove the raw: true parameter completely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant