asyncData takes a longer time to return data.

papakay
0
papakay
commented a year ago

Hi, I really want to commend the great work done on this package.

Please I have a page that takes over 20 seconds to load and that has been a great concern to me. The page is just a form but it gets the form data from an API endpoint. With the asyncData method, the page takes more than 20 seconds. I've also tested the endpoint to confirm if that was the problem, but the endpoint takes less than 0.7 second to return data. This is what my async data looks like

async asyncData({ $axios }) {
    try {
      const response = await $axios.$get("v1/account/me");
      return {
        user: response.data.user
      };
    } catch (e) {
      return {
        user: null
      };
    }
  },

Please what are mine doing wrong?

0
Informations
Question โ€ข Unresolved
#c195 - Created a year ago