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

Use cache :coder option to specify :message_pack #48449

Merged

Conversation

jonathanhefner
Copy link
Member

In #48104, :message_pack was added as a supported value for the cache format version because the format version essentially specifies the default coder. However, as an API, the format version could potentially be used to affect other aspects of serialization, such as the default compression format.

This commit removes :message_pack as a supported value for the format version, and, as a replacement, adds support for specifying coder: :message_pack:

# BEFORE
config.active_support.cache_format_version = :message_pack

# AFTER
config.cache_store = :redis_cache_store, { coder: :message_pack }

In rails#48104, `:message_pack` was added as a supported value for the cache
format version because the format version essentially specifies the
default coder.  However, as an API, the format version could potentially
be used to affect other aspects of serialization, such as the default
compression format.

This commit removes `:message_pack` as a supported value for the format
version, and, as a replacement, adds support for specifying
`coder: :message_pack`:

  ```ruby
  # BEFORE
  config.active_support.cache_format_version = :message_pack

  # AFTER
  config.cache_store = :redis_cache_store, { coder: :message_pack }
  ```
@jonathanhefner jonathanhefner merged commit ff3c8de into rails:main Jun 11, 2023
8 of 9 checks passed
jonathanhefner added a commit that referenced this pull request Jul 25, 2023
Follow-up to #48449.

Since #48449 changed the list of accepted cache format versions back to
just `6.1`, `7.0`, and `7.1`, we can raise a more specific error.
paulreece pushed a commit to paulreece/rails-paulreece that referenced this pull request Aug 26, 2023
Follow-up to rails#48449.

Since rails#48449 changed the list of accepted cache format versions back to
just `6.1`, `7.0`, and `7.1`, we can raise a more specific error.
jonathanhefner added a commit to jonathanhefner/rails that referenced this pull request Sep 10, 2023
This covers rails#47770, rails#47964, rails#48103, and rails#48104, plus the follow-up
changes to `ActiveSupport::Cache::Store` options from rails#48449 and rails#48451.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant