We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Any reason why you are not using cache_key instance method by default?
cache_key
post = Post.find(params[:id]) cache(key: post.cache_key, etag: post.updated_at, expires_in: 2.hours) do post # post.extend(PostRepresenter) etc, any code that renders response end
post.cache_key could also be used to generate etag since the key already includes the updated_at.
post.cache_key
etag
updated_at
This would allow a nicer API:
post = Post.find(params[:id]) cache(post, expires_in: 2.hours) do post # post.extend(PostRepresenter) etc, any code that renders response end
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Any reason why you are not using
cache_key
instance method by default?post.cache_key
could also be used to generateetag
since the key already includes theupdated_at
.This would allow a nicer API:
The text was updated successfully, but these errors were encountered: