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

Include Caching module for ActionController::API #36038

Merged
merged 1 commit into from Apr 22, 2019

Conversation

st0012
Copy link
Contributor

@st0012 st0012 commented Apr 19, 2019

As described in #35602, currently ActionController::API doesn't include Caching module, so it can't perform caching. And even if users include it later manually, it won't inherit application's default cache store for config.action_controller.
So the only way to solve this issue is to include Caching module in ActionController::API too.

This closes #35602

Currently ActionController::API doesn't include Caching module, so it
can't perform caching. And even if users include it later manually, it
won't inherit application's default cache store for action_controllers.
So the only way to solve this issue is to include Caching module in
ActionController::API, too.

This closes rails#35602
@guilleiguaran guilleiguaran merged commit 216ef01 into rails:master Apr 22, 2019
@rafaelfranca
Copy link
Member

It is missing the documentation updated. And do we want caching by default in API?

@rafaelfranca
Copy link
Member

I don't think we want caching by default in API even more because it is about view caching. Not all API controller will use view caching. And the fact that the caching config don't reflect to later included Caching module is not a good reason to change this default. We should document that since it is still possible to set the cache store by doing

self.cache_store = ...

inside the controller. I'm going to revert this.

@st0012
Copy link
Contributor Author

st0012 commented Apr 23, 2019

@rafaelfranca good point 👍will open another PR

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.

Cache_store not set when using ActionCtrl::API and manually including Caching
3 participants