2016-12-01 18:01:59 +00:00
|
|
|
<template>
|
|
|
|
<div>
|
|
|
|
<h1>Cached components</h1>
|
|
|
|
<p>Look at the source code and see how the timestamp is not reloaded before 10s after refreshing the page.</p>
|
|
|
|
<p>Timestamp: {{ date }}</p>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
2018-07-12 12:03:50 +00:00
|
|
|
name: 'Date',
|
2019-07-10 10:45:49 +00:00
|
|
|
serverCacheKey () {
|
2016-12-01 18:01:59 +00:00
|
|
|
// Will change every 10 secondes
|
|
|
|
return Math.floor(Date.now() / 10000)
|
|
|
|
},
|
2019-07-10 10:45:49 +00:00
|
|
|
data () {
|
2016-12-01 18:01:59 +00:00
|
|
|
return { date: Date.now() }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|