提交 861ec91e 编写于 作者: A Angelo capilleri

add cache_if and cache_unless on caching doc

上级 48ac592b
......@@ -104,6 +104,15 @@ This method generates a cache key that depends on all products and can be used i
All available products:
<% end %>
```
If you want to cache a fragment under certain condition you can use `cache_if` or `cache_unless`
```erb
<% cache_if (condition, cache_key_for_products) do %>
All available products:
<% end %>
```
You can also use an Active Record model as the cache key:
```erb
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册