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 cell's name instead of controller_path in cache key generation #15

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

Conversation

yogeshjain999
Copy link
Member

Fixes #13

Note that this change doesn't remove Cell or ::Cell from cell's name, as it is being done in controller_path. I think controller_path is independent of cache key generation, though this is open for discussion.

# Old behaviour

class Post::Cell::Show < Cell::ViewModel
  cache :show # cache key => "post/view/show/"
end
# New behaviour

class Post::Cell::Show < Cell::ViewModel
  cache :show # cache key => "post/cell/show/show/"
end

@apotonick
Copy link
Member

Cool, I think this solves the TRB-specific problem better than in the cells gem. What are we doing with the versioning, though? At least a minor bump as it's an API change, well, not really, but people who're computing cache keys manually could get in trouble.

@yogeshjain999
Copy link
Member Author

Hmm I didn't get the part "computing cache keys manually could get in trouble". Do you mean they override state_cache_key ? Also, agree about this not being an API change. I think this should be a patch release. It would only involve additional cache hits for new 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.

Issue with controller_path for cache keys
2 participants