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

Add support for Rails' recycable cache keys #2334

Merged
merged 1 commit into from
May 6, 2022

Conversation

tvdeyen
Copy link
Member

@tvdeyen tvdeyen commented May 5, 2022

What is this pull request for?

This has been a feature from Rails 5.2 and is enabled by default
from Rails 6.0 and above.

Notable changes

Page#cache_key now simply returns "alchemy/page/<id>" (the Rails default).

Since Rails 6.0 has turned on Rails.application.config.active_record.cache_versioning by default and then uses cache_key_with_version (that then calls cache_version) we can safely make this change.

In the unlikely case that someone had turned off Rails.application.config.active_record.cache_versioning in a Rails 6 application this will "break" the cache, but I think we can take the risk.

Checklist

  • I have followed Pull Request guidelines
  • I have added a detailed description into each commit message
  • I have added tests to cover this change

This has been a feature from Rails 5.2 and is enabled by default
from Rails 6.0 and above.
@tvdeyen tvdeyen requested a review from a team May 5, 2022 19:37
@tvdeyen tvdeyen merged commit 82062c2 into AlchemyCMS:main May 6, 2022
@tvdeyen tvdeyen deleted the recycable-cache-keys branch May 6, 2022 07:37
tvdeyen added a commit that referenced this pull request May 6, 2022
Add support for Rails' recycable cache keys
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.

2 participants