Repository pattern + useAsyncData + Pinia store, hydration + caching problems?
08:30 20 Nov 2025

We follow this article to write all our API calls https://medium.com/@luizzappa/nuxt-3-repository-pattern-organising-and-managing-your-calls-to-apis-with-typescript-acd563a4e046 so we can fetch a resource like so const { data: documents } = await $api.users.getUploadedDocuments(); but we actually populate the reactive state in a pinia store, persisted in Cookie, const documentList = ref([]);, we use this documentList ref in our components. However we notice random cached requests, random network requests and sometimes double hydration from certain requests too, what to do?

typescript caching frontend nuxt.js pinia