How to prevent the browser from asking for the favicon?

前端 未结 3 1081
粉色の甜心
粉色の甜心 2021-02-07 02:58

Is there some directive I could use in my HTML to tell the browser not to ask for the favicon?

3条回答
  •  误落风尘
    2021-02-07 03:44

    No, I don't think there is. From Wikipedia:

    Most web browsers do not require any HTML to retrieve a favicon that conforms to the de facto file name and type (favicon.ico) located in the web site's root. If no favicon link is detected upon HTML page load completion and no previous site visits are recorded in the browser's history, a favicon.ico is requested automatically.[8]

    The only thing you could do is explicitly point the browser to a different location (that for example could return a 204 no content)

    
    

提交回复
热议问题