。favicon与所有其他所有请求之间的时间间隔?

问题描述 投票:1回答:1

我们在一个GT Metrix上进行的速度测试中看到一个一致的模式,该站点的所有资源加载与favicon请求初始化之间存在150-250ms的差距。这延长了满载时间。

任何想法为什么会发生这种情况?

Favicon在HTML文件的开头中引用如下:

<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico"> 

Drupal 7 .htaccess文件如下所示引用了favicon:

# Pass all requests not referring directly to files in the filesystem to
# index.php. Clean URLs are handled in drupal_environment_initialize().
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^ index.php [L]

瀑布的屏幕截图(注意倒数第二个和最后一个请求之间的差距):waterfall diagram of site speed

html apache performance pagespeed gtmetrix
1个回答
0
投票

这是因为不需要图标就可以真正呈现页面,仅显示在标题栏中,因此浏览器会推迟下载它。

(我很好奇自己是否可以更快地强制加载,显然它一点都不微不足道,即使使用预加载或http / 2推送也只能加载两次)

© www.soinside.com 2019 - 2024. All rights reserved.