react-server
react-server copied to clipboard
Use custom headers to render RSC / remote components
Description
The rendering logic is using the standard Accept HTTP header to drive the response type and caching used by the framework. This is not ideal for proxies and caching. See some additional information at https://github.com/lazarv/react-server/pull/49
Suggested solution
Use custom HTTP headers to drive the rendering logic and to choose the response type and framework level caching type.
- use
React-Server-RSCheader to request an RSC payload response - use
React-Server-Remoteheader to request an RSC delegation response - use
React-Server-Standaloneheader to request standalone type routing logic
Existence of the above HTTP headers will drive the rendering logic.
Possible combinations are:
-
React-Server-RSCwith an optionalReact-Server-Standalone -
React-Server-Remotewith an optionalReact-Server-Standalone
React-Server-RSC and React-Server-Remote can't be used in the same request!
Alternative
No response
Additional context
No response
Validations
- [X] Follow our Code of Conduct
- [X] Read the Contributing Guidelines.
- [X] Read the docs.
- [X] Check that there isn't already an issue that request the same feature to avoid creating a duplicate.