How to force ie11 to request a new favicon?

后端 未结 4 1643
清歌不尽
清歌不尽 2021-01-15 03:01

I am working on a website which changes its favicon depending on the user details logged in. A controller processes this request at the back-end and sends the appropriate fa

4条回答
  •  粉色の甜心
    2021-01-15 04:00

    Warning: although this answer is (in my opinion) a good advice, it does not work with IE11

    Adding URL parameters to the regular favicon path is a useful technique to update a favicon and force browsers to reload it. However, browsers and notoriously known to be very lazy when it comes to favicon loading. So refreshing your favicon that often is probably beyond the power of the extra URL parameter technique.

    I advice you to give a try to favicon.js. This JavaScript library is designed to create dynamic favicons and let you do quite amazing stuff.

提交回复
热议问题