大网数据广告活动
网站运营与故障问答

How do search engines behave with canonical URLs between an SPA and a server-rendered version?

· 52CE 我爱测

I'm planning to build an application which will end up displaying duplicate content. app.domain.com/content/ID # Completely rendered on the client, behind a wall of JS www.domain.com/content/ID # Server-rendered, SEO-friendly Und…

问题原文

原帖链接 · fnune · CC BY-SA 4.0

I'm planning to build an application which will end up displaying duplicate content.

app.domain.com/content/ID # Completely rendered on the client, behind a wall of JS
www.domain.com/content/ID # Server-rendered, SEO-friendly

Under app.domain.com I'll be serving a React SPA that renders completely on the client.

Under www.domain.com I'll be serving the same React application but rendered on the server, to improve SEO.

The content on both applications will be the same, but presumably the server-rendered version will have better SEO. To avoid duplicate content problems, I'll be following Google's "Consolidate duplicate URLs" guide. I will:

  • Specify a preferred domain: www.domain.com.
  • Set a rel=canonical header in my response for pages under app.domain.com/content/ID pointing to the corresponding www.domain.com/content/ID URL.

Here is my question: which application's page speed counts towards SEO? Is it the page speed of the client-side rendered application (slow because of all the JS that needs to be downloaded in a blocking way) or is it the page speed of the server-render, SEO-friendly version?

已采纳解答

原帖链接 · Hayk Saakian · CC BY-SA 4.0

I have not seen this exact situation, but in similar situations (where there are two URLs and one points to another) Google tends to use the canonical version.

Word of warning though: Splitting up your site between app.domain.com and www.domain.com will be "eventually" consistent in Google. While they do recognize canonical tags, they don't always do so very quickly.

The duplicate domain will slow you down from an overall SEO perspective.

What kind of speed difference are you talking about by the way?

If it's the difference between 1 second and 2 seconds then it's probably not worth having them separate.

Use a tool like gtmetrix to run speed tests on your competition.

If all your competitors are loading after 5-10 seconds, then your improvement from 2 seconds to 1 second won't really make a big difference in the grand scheme of things.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2019-03-13)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。