Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 74d64d8

Browse files
Update README.md
1 parent 0a146eb commit 74d64d8

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

‎README.md‎

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,16 @@ export default class App extends Component {
5959
}
6060
// ...
6161
```
62+
## Streaming HTML Markup
63+
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.
6272

6373
## Cache Options
6474
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.
@@ -98,7 +108,7 @@ ReactCC.renderToString(<App />, cache, 1000);
98108

99109
## API
100110

101-
### ReactCC
111+
### React Component Caching
102112
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.
103113

104114
### ComponentCache
@@ -131,7 +141,7 @@ ReactCC.renderToStaticMarkup(<App />, cache);
131141

132142
### renderToNodeStream
133143
- `component`: The React component being rendered
134-
- `cache`: The component cache
144+
- `cache`: The component cache object
135145
- `res`: The response object that Express provides
136146
- `htmlStart`: Start of html markup in string form
137147
- `htmlEnd`: End of html markup in string form
@@ -146,7 +156,7 @@ ReactCC.renderToNodeStream(<App />, cache, res, htmlStart, htmlEnd);
146156

147157
### renderToStaticNodeStream
148158
- `component`: The React component being rendered
149-
- `cache`: The component cache
159+
- `cache`: The component cache object
150160
- `res`: The response object that Express provides
151161
- `htmlStart`: Start of html markup in string form
152162
- `htmlEnd`: End of html markup in string form

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /