关于仅提供一行缩小的 HTML 页面的问题

发布于 2024-11-29 21:22:30 字数 521 浏览 4 评论 0原文

出于某种原因,我的网站新版本生成的页面仅包含一行 HTML 代码,有点精简的 HTML。 也就是说从html到/html无论内容多少都是一行。

另一个原因是,我对实时发布这段代码有点担心,因为我担心仅提供一行 HTML 文件可能会出现 SEO 问题。当然,这只是一种没有任何相关信息的感觉,这可能很奇怪,但我仍然很害怕。看到所有的业务都与SEO有一定的联系。另一方面,再次测试新版本的Google Page Speed在线版将原来的分数提高了相当大的幅度。

那么,无所畏惧吗?你们有人对此有意见吗,这会影响 SEO 排名吗? 这也是一个好的做法吗(只要它不影响任何 webdev 进程或任何服务器性能问题)?

我还想知道浏览器是否没有一种“差异”源代码渲染,也就是说,如果浏览器看到与上一页完全相同的标题,它将快速显示。因此我告诉我:嘿,如果浏览器仅输入一行,则此功能可能会被破坏,它可能不会触发差分识别,直到没有换行符告诉他停止解析第一行......

好吧,哼,你看。 ..不确定这样做是否正确。 如果这是天真的恐惧,请原谅。

感谢您对此的想法!

For a reason my websites new version produce pages with HTML code in one line only, sort of minified HTML.
That is to say from html to /html it is one line regardless of amount of content.

For another reason, i'm a litlle bit anxious about releasing this code live, because i'm fearing a possible SEO issue on serving one line only HTML files. Sure that is just a feeling having no information on this, and that may be weird feeling, still i'm fearing it, A LOT. See all business is somewhat linked to SEO. In other hand, tested new version again Google Page Speed online increased original score by a confortable amount.

So, fear for nothing ? Do any of you have input on this, can this affect SEO ranking ?
Is this good practice also (provided it does not affect at all any process of webdev nor any server perf issue) ?

I was also wondering if browser had not a kind of "differential" source code rendering, that is if the browser see the exactly same header that previous page it will show quickly. Thus i told me : hey, this feature might be break if the browser is feeded with one line only, it may not fire differential recogn till no line break to tell him to stop parsing first line...

Well, hem, you see... Not sure of doing this right.
Forgive if its naive fear.

Thanks for your thought on this !

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

南街女流氓 2024-12-06 21:22:30

我不认为将所有 HTML 放在一行中会影响 SEO - 毕竟,必须解析 HTML 结构。解析器不关心空格。

这只是我的推理 - 我不确定是否有人能够给你一个明确的答案。

如果您担心,请考虑根本不这样做。与通过 gzip 压缩 HTML 所节省的成本相比,在换行符中节省几个字节几乎毫无意义。

I don't think that having all the HTML in one line is going to affect SEO - after all, the HTML structure has to be parsed. The parser doesn't care about whitespaces.

This is just my reasoning though - I'm not sure whether anybody will be able to give you a definite answer.

If you're worried, consider not doing this at all. Compared to the savings that you get from gzip compressing your HTML, saving a few bytes in line breaks is almost meaningless.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文