Swr: Performance discussion

Created on 30 Oct 2019  路  4Comments  路  Source: vercel/swr

Hi, This is an interesting hooks. However, keep re-validating the state by calling the Server API may casing the performance issues if there are many concurrent users. How could we handle this issue? shall we combine this with Redux?

Thanks and Regards
Duy

discussion

Most helpful comment

Thank you so much for your replay. This is really a potential component to replace Redux and simplify the development as well.

Thanks
Duy

All 4 comments

By default refreshInterval is disabled (it doesn't do polling, it only refresh when you run mutate, trigger or your tab is focused again.

Like @sergiodxa mentioned, you can configure how often the hook re-fetches data. By default, refreshInterval is disabled, and you can customize options like dedupingInterval to decrease the number of requests made.

Also focus revalidation can be disabled too 馃憤

Thank you so much for your replay. This is really a potential component to replace Redux and simplify the development as well.

Thanks
Duy

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Ephys picture Ephys  路  3Comments

bbenezech picture bbenezech  路  5Comments

bywo picture bywo  路  4Comments

Svish picture Svish  路  5Comments

nainardev picture nainardev  路  4Comments