Skip to content

Commit 0eee829

Browse files
Surjit Kumar SahooSurjit Kumar Sahoo
authored andcommitted
restructure
1 parent dc83b7b commit 0eee829

4 files changed

Lines changed: 17 additions & 1 deletion

File tree

docs/1.architecture/6.state-management/3.global-state-redux.mdx

Whitespace-only changes.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
sidebar_position: 5
3+
slug: api-caching
4+
title: Caching API Calls
5+
---
6+
7+
# Why?
8+
9+
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.
10+
11+
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.
12+
User will see the results instantly, no more loading screen.
13+
14+
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
15+
16+
[API caching methods and best practices are documented here →](../1.architecture/6.state-management/4.api-and-caching.md)

docs/1.architecture/7.misc-structural-guides/_category_.json renamed to docs/6.misc-structural-guides/_category_.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"label": "Misc Structural Guidelines",
33
"collapsed": true,
4-
"position": 7,
4+
"position": 6,
55
"link": {
66
"type": "generated-index",
77
"description": "Guidelines for choosing naming-conventions, avoiding nested if-checks and other structural best practices in React applications. These guidelines help maintain code readability, consistency, and ease of maintenance across your React projects."

docs/1.architecture/7.misc-structural-guides/naming-convention.md renamed to docs/6.misc-structural-guides/naming-convention.md

File renamed without changes.

0 commit comments

Comments
 (0)