K
K
Kaga882020-07-05 12:20:55
Web development
Kaga88, 2020-07-05 12:20:55

"Cheaper" js array filter or API request?

The bottom line is, backend - Django REST framework, Vue.js frontend. From the backend, through the API, we get an array of data. How is it "cheaper" to work with data, for example, in a table - sorting, filtering, etc. Processing an array in js, or is it better to request a "new" array all the time by sorting / filtering DRF? As long as the data volumes are not large, the difference is not visible, but I would like to foresee this moment.

"Cheaper" - means the speed of information processing.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir Korotenko, 2020-07-05
@Kaga88

Follow the rule of thumb, if there is no paging or Infiniti skul then handle everything on the client.

A
Alex, 2020-07-05
@Kozack

From the point of view of server maintenance costs, I think it will be cheaper to request the entire data array once and cache it for a while.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question