I am building an app with apollo and vue (nuxt) and I wondered if I have to save already fetched pages in my store, if I want it to be superquick, whenever a user returns to page he already visited.
Right now I have a part where I fetch some apollo queries, before displaying the page. After receiving the data I could save it into the store, to have the content ready whenever somebody returns to that page.
But maybe Apollo is doing that work for me with its smart caching behaviour?
Thanks for some inputs on this question. Cheers
Apollo utilizes an in-memory cache that will cache your query responses and then retrieve the responses from cache if the same query is fired again. This is the default behavior, although it can also be modified by providing a specific fetch policy.
Because the cache is stored in memory, it will be wiped if the user refreshes the page or navigates away. If you need to persist the cache, take a look at apollo-cache-persist.