-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
renderToString vs renderToStream #26
Comments
It was actually to make the code more easy to read and to start with (mostly for the renderRoute function). Now that Nuxt.js will be soon released in V1, I don't see any inconvenient to use the streams to send back the HTML to the server! |
I think providing a stream handler callback will be very useful. Consider the following scenario: Although Vue.js has a component based cache mechanism, it has several problems:
So I want to implement a vue independent cache system. If Nuxt could provide a hook to let me handle the stream, It will be very nice! |
It will be implemented before the |
Awesome! This mechanism is very helpful for websites with many user-generated-pages! |
How to build rest apis in nuxt js, |
@slrohit This is out of the job scope of NUXT. NUXT should be just about server-side rendering. API should be implemented in a separate server, or a middleware if you are using NUXT as a middleware. |
@slrohit I recently used https://github.com/zeit/micro for building a rest api, maybe have a look at that repo. Your usecase has nothing to do with |
Good to mention that according to vue ssr docs streaming is not recommended as we need to evaluate all async components in order to prepare complete headers. So it may introduce performance downsides! (This is actually not opposite to @fenivana's approach since it is streaming the cached response not during response generation :)) )
|
v1.0 seems to be released soon. Where should I see to know actually Nuxt.js makes use of streaming SSR? |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
According to the vue.js docs says:
I see Nuxt is using
renderToString
to yield the html string. I'm interested the reason why Nuxt not usingrenderToStream
?The text was updated successfully, but these errors were encountered: