Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the use to serve favicon from server

Tags:

node.js

I have a doubt regarding favicon, I can add favicon directly in html file itself with following code.

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

I have tried with above code, it's working fine. I have seen there are some modules in npm to server favicon images. If I add through html, why I have to use this modules to serve.

like image 892
grandhi Avatar asked Sep 28 '22 12:09

grandhi


1 Answers

For the case of serve-favicon module:

Why use this module?

  • User agents request favicon.ico frequently and indiscriminately, so you may wish to exclude these requests from your logs by using this middleware before your logger middleware.
  • This module caches the icon in memory to improve performance by skipping disk access.
  • This module provides an ETag based on the contents of the icon, rather than file system properties.
  • This module will serve with the most compatible Content-Type.
like image 86
alditis Avatar answered Oct 05 '22 08:10

alditis