How can I prevent duplicate fetch #7766
Unanswered
WreewanMorhee
asked this question in
Q&A
Replies: 2 comments
-
You need to cache it, one way could be to use an HTTP cache with the Cache-Control header to cache the whole response, note that the document response and the data response will have separate caches in this case. Another way is to use a server-side cache (e.g. lru-cache or Redis) to cache the data server-side, which will let you have more control and even share the cache between users if you want. https://sergiodxa.com/articles/http-vs-server-side-cache-in-remix |
Beta Was this translation helpful? Give feedback.
0 replies
-
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I know
shouldRevalidate
this functionbut let me describe my question first:
I go to first page: mydomain/l?page=1 (fetch data about page=1, we assume data here called A_Data)
and got to next page : mydomain/l?page=2 (fetch data about page=2, we assume data here called B_Data)
then
when I back to mydomain/l?page=1
How should I still using previous A_Data and prevent duplicate fetching about page=1 ?
Beta Was this translation helpful? Give feedback.
All reactions