react-server icon indicating copy to clipboard operation
react-server copied to clipboard

Use custom headers to render RSC / remote components

Open lazarv opened this issue 1 year ago • 0 comments

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-RSC header to request an RSC payload response
  • use React-Server-Remote header to request an RSC delegation response
  • use React-Server-Standalone header to request standalone type routing logic

Existence of the above HTTP headers will drive the rendering logic.

Possible combinations are:

  • React-Server-RSC with an optional React-Server-Standalone
  • React-Server-Remote with an optional React-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

lazarv avatar Sep 26 '24 09:09 lazarv