You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Before using the singleFetch-flag one was able to set different headers on the initial doc/HTML request vs. subsequent data-only/JSON requests.
This for example was helpful to avoid caching docs/HTML to assert that references and JS are always fresh, but do cache subsequent data requests. The data requests were than varied in CDN via app-version-cookie and could be cached without risking version skew.
This seems to be more difficult because single fetch seems not to distinguish between data requests and the initial doc fetch in loaders. I could parse e.g. a request header like Accept in the loader or similar, but it seems a convoluted workaround as Remix probably already knows what kind of request this is.
Is there some flag or any other indicator that could be used?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Before using the
singleFetch
-flag one was able to set different headers on the initial doc/HTML request vs. subsequent data-only/JSON requests.This for example was helpful to avoid caching docs/HTML to assert that references and JS are always fresh, but do cache subsequent data requests. The data requests were than varied in CDN via app-version-cookie and could be cached without risking version skew.
This seems to be more difficult because single fetch seems not to distinguish between data requests and the initial doc fetch in loaders. I could parse e.g. a request header like
Accept
in the loader or similar, but it seems a convoluted workaround as Remix probably already knows what kind of request this is.Is there some flag or any other indicator that could be used?
Beta Was this translation helpful? Give feedback.
All reactions