Understanding common challenges with server state
By now, you have probably figured out that the server state comes with quite its fair share of challenges. These challenges made React Query stand out even more when it came out because it solved them in such a simple way for developers that it seemed too good to be true.
Now, what are these challenges, and why are they so complex to solve most of the time?
In this section, we will see all the common challenges that we have with the server state and understand a bit of the hard work we had to do as developers to solve them ourselves before we had React Query.
Caching
This is probably one of the hardest challenges we face in server state management.
To improve your page performance and make your site more responsive, very often, you will need to cache your data. This means being able to reuse data that you previously fetched to avoid refetching it from the server once again.
Now, you might be thinking that this sounds...