Everybody knows how to set up a favicon.ico link in HTML:
I found an interesting solution on this page. It is german but you will be able to understand the code.
You put the base64 data of the icon into an external stylesheet, so it will be cached. In the head of your website you have to define the favicon with an id and the favicon is set as a background-image in the stylesheet for that id.
link#icon {
background-image:url("data:image/x-icon;base64,");
}
and the html
...
...