Skip to content

Commit

Permalink
Fixed description of the cache_key_with_version method [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
soartec-lab committed Apr 3, 2019
1 parent 015bfd1 commit e27a511
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion guides/source/caching_with_rails.md
Expand Up @@ -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

Expand Down

0 comments on commit e27a511

Please sign in to comment.