TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

You don’t need any HTML to add a favicon to your site

28 点作者 mathias超过 14 年前

4 条评论

eli超过 14 年前
If you've ever checked the 404 logs on a site with no favicon you already know this.
评论 #2250154 未加载
taylorbuley超过 14 年前
I found myself in a favicon pickle just the other day. I noticed one of the only non-CDN assets we had was favico.ico, which was being requested from origin servers along with every request, putting an unneeded load on Apache. Ideally we might put static assets like that on something like Nginx, but short term I was looking into how I could reduce the (albeit small) load created by favicon requests without changing the application architecture.<p>Ruling out Nginx, the pickle was that I should probably rewrite requests to domain.com/favico.ico to cdn.domain.com/favico.ico. But that rewrite has just as much or more httpd overhead as just serving the favico, with an extra client-side performance hit as the client has to do an extra http request to follow the 301.<p>I ended up with just using a &#60;link&#62; tag in &#60;head&#62;, which should at least get modern browsers off Apache's back. But I wish there was a more complete solution.
sjs382超过 14 年前
<i>rel="shortcut icon" considered harmful</i><p>No, it isn't.
sjmulder超过 14 年前
If either of these options should be considered harmful, it's the magic URL. This particular one has been responsible for countless useless requests. Another consideration is whether it's a good idea to have a standard dictate (parts of) the URL layout of a website.
评论 #2251299 未加载