gpt4 book ai didi

html - PageSpeed 工具的奇怪修复

转载 作者:搜寻专家 更新时间:2023-10-31 02:25:46 25 4
gpt4 key购买 nike

当我在 PageSpeed Tools(一种由 Google 优化网页的工具)中测试我的网页时,我遇到了这些问题:

问题#1:

Avoid a character set in the meta tag

The following resources have a character set specified in a meta tag.
Specifying a character set in a meta tag disables the lookahead downloader in IE8.
To improve resource download parallelization, move the character set to the HTTP Content-Type response header.

问题#2:

Specify a character set

Specifying a character set early for your HTML documents allows the browser to Begin executing scripts IMMEDIATELY.

Suggestions for this page

The following resources have not set the character set in HTTP headers.
If you specify a character set in there, speeds up the rendering in the browser.

但我不明白为什么会出现这些问题,因为我在头部指定了这样的字符集:

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-15" />

问题:有人可以帮我解决这些问题吗?

最佳答案

它告诉您:将字符集移至 HTTP Content-Type 响应 header 。看看这个:

Wikipedia - List of HTTP header fields

基本上,客户端从服务器返回的实际 HTTP 响应应该设置 Content-Type 字段。如果你不能改变这个,那么就在 <meta> 中设置它。照原样标记。

编辑:

如果可以,请修改服务器上的 .htaccess 文件以包括:

AddType 'text/html; charset=iso-8859-15' html

这将导致所有提供的 HTML 文件都包含适当的响应 header 。

关于html - PageSpeed 工具的奇怪修复,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11157619/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com