DEV Community

Discussion on: How is Remix different from Next.js

Collapse
 
ug02fast profile image
Arthur Zhuk

/2. Complete control over the request from an SSR route

in next all you need to do is call
res.setHeader('Cache-Control', 's-maxage=60, stale-while-revalidate')
to set the header.

Collapse
 
powerfuldruid profile image
powerfuldruid

Isn't this header native to Vercel though? Regardless, you can still accomplish this to a certain extent using a data fetching library like useSWR, no?

Collapse
 
dabit3 profile image
Nader Dabit

Ah interesting, thanks for this. I'll also update the post with more info directly from the docs to add more context around how to manage the response.