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
To use streaming on the server side, use either the renderToStaticNodeStream or renderToNodeStream. Both streaming option works with caching, but not yet compatible with templatization. To use the streaming functions, simply pass in these 5 arguments:
64
+
(
65
+
`component`: The React component being rendered
66
+
`cache`: The component cache object
67
+
`res`: The response object that Express provides
68
+
`htmlStart`: Start of html markup in string form
69
+
`htmlEnd`: End of html markup in string form
70
+
).
71
+
The benefit that comes with streaming is faster time to first byte, which translates to faster viewing of page content.
62
72
63
73
## Cache Options
64
74
React Component Caching provides its own cache implementation as well as support for Redis and Memcached. Simply create your preferred cache and pass it into one of the rendering methods.
React Component Caching gives you access to all four of React 16's server-side rendering methods, as well as additional functionality. Available methods are described below.
0 commit comments