如何防止非 www 到 www URL 之间 301 重定向带来的性能损失?
我有一个网站,它将非 www URL 重定向到 www 版本,以优化 SEO。然而,这会影响用户性能,因为对服务器的非 www 请求/应答需要 500 毫秒才能向 www URL 发出新请求,并且网站将开始加载。如果用户仅键入不带 www 的域名,则第一次打印网站会损失半秒的时间。
是否有一种方法可以防止用户出现这种性能损失,同时保留唯一参考入口点的优势?也许只针对 SEO 机器人进行重定向?
I have a website which redirect non-www URL to the www version in order to optimize the SEO. However this impact user performance because the non-www request/answer to the server took 500ms after what it will make a new request to the www URL and the website will start loading. This is half a second lost to get the first print of the website if the user type only the domain name without www
Is there a way to prevent this performance loss for the user and yet keep the advantages of an unique entry point for the referencement ? maybe targeting only SEO robots for the redirection ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果是性能问题,首先要做的是确保网站所有内部url都指向同一个版本(有或没有www、http或https)...然后选择www为主服务器级别(来自 plesk 作为默认版本),甚至是域面板中的 DNS 区域级别。
If it is a question of performance, the first thing to do is to make sure that all the internal urls of the website point to the same version (with or without www, http or https)... and then select www as the main one at the server level (from plesk as the default version), or even at the dns zone level in the domain panel.