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
On first load of the document it sends that header correctly.
However, when switching pages with the <Link when it sends the data?_routes XHR request to do the quick transition, the headers always come back no-store
I do have a function in entry.server.tsx to set cache-control in handleDataRequest to no-store.
In most cases this is what I want. However, in this specific case (because the data doesn't change very often and I'd like it to be cached by my CDN), I'm trying to override that header using the headers function for the two routes.
I'm using React Router as a...
library
Reproduction
SSR site with two routes, and on each page
<Link
between them.Add a
headers
function to set acache-control
header on the route.On first load of the document it sends that header correctly.
However, when switching pages with the
<Link
when it sends thedata?_routes
XHR request to do the quick transition, the headers always come backno-store
I do have a function in
entry.server.tsx
to setcache-control
inhandleDataRequest
tono-store
.In most cases this is what I want. However, in this specific case (because the data doesn't change very often and I'd like it to be cached by my CDN), I'm trying to override that header using the
headers
function for the two routes.System Info
Used Package Manager
npm
Expected Behavior
I expect the
headers
function in the route to set the headers on the?data
request just like it does for the initial HTML doc request.Actual Behavior
Only the initial doc load uses the
headers
function return value.The text was updated successfully, but these errors were encountered: