Answer the question
In order to leave comments, you need to log in
Do I need to cache api data for pages in paginator?
Greetings.
Routing and vuex are used. There is a List of Movies
page .
Let's say 40 of them are shown on one tab.
The work looks like this:
1) went to page number X
2) received information via API (there are a lot of it and it is different) for these 40 films of this page
3) formed my own list of films based on it and passed them to vuex
It would be easier, of course, every time you go to the tab, make a new request to the api here.
But the disadvantages are that if you were on the first tab, and now you’ve returned to it again, it seems like you already received the data, and you send the request again. Although it is possible that caching from the browser will save here, I have not yet checked this moment when the difference is in the get parameters.
Or is it necessary after stage 2) another stage?:
2.5) Let's save somewhere the data about this page of films
Questions are here
a)
Wouldn't it be too much?
Because it adds a lot of problems. Suddenly, you need to change the functionality on the fly and display 50 films, not 40. But they were stored in the cache page by 40. Calculating, counting will not be very interesting
b) The memory will be clogged with all this data
c) But if you do it all the same, then the cache such somewhere separately it is necessary to store, obviously not in vuex, right?
Thank you.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question