Commit 636edadf authored by Evan You's avatar Evan You

fix caching mismatch by taking timeAgo into account (fix #45)

parent 5d967409
......@@ -27,12 +27,20 @@
</template>
<script>
import { timeAgo } from '../filters'
export default {
name: 'news-item',
props: ['item'],
// https://github.com/vuejs/vue/blob/next/packages/vue-server-renderer/README.md#component-caching
serverCacheKey: props => {
return `${props.item.id}::${props.item.__lastUpdated}`
return `${
props.item.id
}::${
props.item.__lastUpdated
}::${
timeAgo(props.item.time)
}`
}
}
</script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment