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

Update Caching with Rails guide [ci skip] #30447

Merged
merged 1 commit into from
Aug 29, 2017

Conversation

yhirano55
Copy link
Contributor

Summary

  • Added quotations on L178 and L287.
  • Changed to single quote same as others on L275 and L287.

@rails-bot
Copy link

r? @kamipo

(@rails-bot has picked a reviewer for you, use r? to override)

@eileencodes eileencodes merged commit 07402aa into rails:master Aug 29, 2017
@@ -284,7 +284,7 @@ class Product < ApplicationRecord
end
```

NOTE: Notice that in this example we used the `cache_key` method, so the resulting cache-key will be something like `products/233-20140225082222765838000/competing_price`. `cache_key` generates a string based on the models `id` and `updated_at` attributes. This is a common convention and has the benefit of invalidating the cache whenever the product is updated. In general, when you use low-level caching for instance level information, you need to generate a cache key.
NOTE: Notice that in this example we used the `cache_key` method, so the resulting `cache-key` will be something like `products/233-20140225082222765838000/competing_price`. `cache_key` generates a string based on the model's `id` and `updated_at` attributes. This is a common convention and has the benefit of invalidating the cache whenever the product is updated. In general, when you use low-level caching for instance level information, you need to generate a cache key.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel that it should be the resulting cache-key, not the resulting `cache-key`.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Partial reverted in c4e576f.

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.

None yet

4 participants