G
G
Gennady S2019-07-17 15:52:46
Search Engine Optimization
Gennady S, 2019-07-17 15:52:46

Will this SPA/SEO without SSR work for search engines?

Let's say there is a blog engine with articles and comments, and we use PHP on the server and Vue / Angular on the client (it doesn't matter what exactly, it is desirable to decouple the server from the client technology (and vice versa)).
For example, on any external request to the site, we issue a launch point for the SPA, mixing in primitive static content, say, at /post/112?commentsPage=3

<head>Тут метаданные конкретной статьи</head>
<body>
<app-root>
<h1>Здесь статья<h1><p>И ее текст с датой, автором и т.д....</p> <a href="/post/113">Следующая статья</a>
 <h2>Комментарии</h2>
 <p>Здесь комментарии ...</p>
 <a href="/post/112?commentsPage=2">Предыдущие комментарии</a>
</app-root>
</body>

In turn, the client engine does not know anything about it, overwrites the content and processes the route itself according to its routing engine, requesting both the article, relatively speaking, /api/post?id=112, and comments, say, /api/comments? postId=112&page=3
The search engine needs to receive HTML and the code is somewhat duplicated, but in this case it is not necessary to use NodeJS and certain systems on the server. What is the reason? The engine on the server does not depend on the client, for example, it is enough to change the "theme", i.e. replace templates to eliminate SPA altogether. And it will work on any hosting. Again, hypothetically, this approach can be implemented in popular CMS templates.
Tell me, are there any pitfalls in this approach?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question