Skip to main content

Why?

If the user is frequently navigation between pages, and on every page visit if we are triggering API calls to fetch the data for the page, the user will see a loading screen every single time.

While it can be deemed acceptable user-experience. It can still be improved. If the data from API calls are cached. And the user frequently navigates between the pages, there's no need to call the API again, we can just return the same existing cached data. User will see the results instantly, no more loading screen.

Only fetch the data when you really need to fetch. E.g. on the first time page visit, when the parameters change such as filters or IDs etc

API caching methods and best practices are documented here →