A
A
Alexander Savenko2018-07-23 11:05:19
Vue.js
Alexander Savenko, 2018-07-23 11:05:19

Is a Vue news site with server-side rendering and good SEO real?

Hello!
There is a task to build a news site, it is supposed to use JS (So the customer wants). I looked that for good SEO you need to use server-side rendering.
I have a couple of questions:
1) Do I understand correctly that if there are 1000 articles on the site, then we will actually have 1000 pages on the server? Or can you create a page template?
2) How is state passed between requests? For example, the user logged in, hidden the password entry form and displayed the message "Hi, Vasya!" How is this state not lost when the page is reloaded? If all this happens on the node side, as the data from different users does not get confused (Vasya cannot see Petya's data), as far as I understand the idea of ​​​​SRR, we simply transfer the application build from the client browser to the node and, roughly speaking, Vasya and Petya look at the same monitor.
3) All of the above problems / misunderstandings are solved by nuxtjs.org and I just need to figure it out?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
#
#FFFFFF, 2018-07-23
@savenko

Check out https://nuxtjs.org/ (documentation in English is better, translation is behind) - implements server rendering easily and simply, almost automatically. It will only be necessary to slightly change the approach to development on Vue, for example, routes and plugins are used differently here. Seems like the only sane option at the moment.
Pages are generated on the fly when requested by the client. Naturally, this will require a Node.js server in production, not only in local development.
I also tried using the SSR plugin for Vue, but Nuxt is much cooler.

V
Vladimir, 2018-07-23
@Casufi

1) No, the page is generated by the server before being served, plus it is possible to set up caching.
2) This is not a question about Vue, you first need to go here https://learn.javascript.ru/
3) These problems are solved by studying web development.
Concerning authorization, the answer was already How to make authorization for SSR application?

A
Anton Anton, 2018-07-23
@Fragster

1) Naturally, templates are used. If the site is "conditionally" static, then you can use the prerender
2) cookies, custom request headers with keys, etc. - everything is standard. on the side of the node - its own session mechanism .
3) yes

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question