Fixed description of the `cache_key_with_version` method [ci skip]

This commit is contained in:
soartec-lab 2019-04-02 23:53:45 +09:00
parent 015bfd1e70
commit e27a511b66
1 changed files with 1 additions and 1 deletions

View File

@ -302,7 +302,7 @@ class Product < ApplicationRecord
end
```
NOTE: Notice that in this example we used the `cache_key_with_version` method, so the resulting cache key will be something like `products/233-20140225082222765838000/competing_price`. `cache_key_with_version` 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.
NOTE: Notice that in this example we used the `cache_key_with_version` method, so the resulting cache key will be something like `products/233-20140225082222765838000/competing_price`. `cache_key_with_version` generates a string based on the model's class name, `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.
### SQL Caching