Skip to content

update zh/caching.md #119

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

Merged
merged 1 commit into from
Aug 24, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion zh/caching.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export default {
}
```

请注意,可缓存组件**还必须定义一个唯一的 "name" 选项**。通过使用唯一的名称,每个缓存键(cache key)对应一个组件:你无需担心两个组件返回同一个 key。
请注意,可缓存组件**还必须定义一个唯一的 `name` 选项**。通过使用唯一的名称,每个缓存键(cache key)对应一个组件:你无需担心两个组件返回同一个 key。

`serverCacheKey` 返回的 key 应该包含足够的信息,来表示渲染结果的具体情况。如果渲染结果仅由 `props.item.id` 决定,则上述是一个很好的实现。但是,如果具有相同 id 的 item 可能会随时间而变化,或者如果渲染结果依赖于其他 prop,则需要修改 `getCacheKey` 的实现,以考虑其他变量。

Expand Down