Home

Issue: 422

cache async data

[issue link]

I want to request async dada in page:

As the doc say that, the sync request must be placed in data() for server rendered, so my code is :

export default {
    name: 'home',
    serverCacheKey () {
      return Math.floor(Date.now() / 10000)
    },
    data () {
      return axios.get('repo/latest').then(res => {
        return {
          latestRepos: res.data
        }
      })
    }
  }

but every time I open this page, I can find the ajax request is been sended to my server.

so the cache has no point?

This question is available on Nuxt.js community (#c364)