HTML meta 详解

2020-04-16 08:15:30易采站长站整理

keywords

用于告诉搜索引擎,你网页的关键字

revisit-after

如果页面不是经常更新,为了减轻搜索引擎爬虫对服务器带来的压力,可以设置一个爬虫的重访时间。如果重访时间过短,爬虫将按它们定义的默认时间来访问。举例:


<meta name="revisit-after" content="7 days">

renderer

renderer是为双核浏览器准备的,用于指定双核浏览器默认以何种方式渲染页面。比如说360浏览器。举例:


<meta name="renderer" content="webkit">
//默认webkit内核
<meta name="renderer" content="ie-comp">
//默认IE兼容模式
<meta name="renderer" content="ie-stand">
//默认IE标准模式

referrer

referrer 控制document发起的Request请求中附加的Referer HTTP header(https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referer),相应的值在content中:

content含义
no-referrer不发送HTTP Referer头
origin发送document的origin
no-referrer-when-downgrade将origin作为referer发送到和当前页面同等安全的URLs(https-> https),但不会将origin发送到不安全的URLS(https-> http)。这是默认行为。
origin-when-crossoriginsame-origin的请求,发送的完整URL(剥离参数),但在其他情况下只发送origin
unsafe-URLsame-origin 或 cross-origin的请求,将发送完整的URL(剥离参数)

robots

robots用来告诉爬虫哪些页面需要索引,哪些页面不需要索引。

描述Used By
index允许robot索引本页面(默认)All
noindex不允许robot索引本页面All
follow允许搜索引擎继续通过此网页的链接索引搜索其它的网页(默认)All
nofollow搜索引擎不继续通过此网页的链接索引搜索其它的网页All
none相当于noindex,nofollowGoogle
noodp禁止使用Open Directory Project描述(如果有的话)作为搜索引擎结果中的页面描述。Google, Yahoo, Bing
noarchive要求搜索引擎不缓存页面内容Google, Yahoo, Bing
nosnippet禁止在搜索引擎结果中显示该页面的任何描述。Google, Bing
noimageindex要求此页面不作为引用页面的索引图像的显示。