fetch deduplication in server component that use also cookie to perform the request
Unanswered
Rex posted this in #help-forum
RexOP
Hi !
i've the following 'problem', i've created a Sidebar component ( server ) that fetches from server the visible links for the user based on it's auth level, so the fetch will send also the cookie of the user.
So far no problem..
the problems come the way i'm using this component, 'cause in mobile/tablet the sidebar a children of a Dialog ( for the classic show/hide effect) while in desktops is children of a simple <aside>.
Since the component is mounted twice i'm hitting the server two times each refresh.. so there's a way to deduplicate the fetch even if is using the cookie ? (obvs for a very short time, just to avoid double request in the same moment)
thanks
i've the following 'problem', i've created a Sidebar component ( server ) that fetches from server the visible links for the user based on it's auth level, so the fetch will send also the cookie of the user.
So far no problem..
the problems come the way i'm using this component, 'cause in mobile/tablet the sidebar a children of a Dialog ( for the classic show/hide effect) while in desktops is children of a simple <aside>.
Since the component is mounted twice i'm hitting the server two times each refresh.. so there's a way to deduplicate the fetch even if is using the cookie ? (obvs for a very short time, just to avoid double request in the same moment)
thanks