Favicon does not change, ans is saved as URI

In my project, I am doing the following <link rel="icon" href="/static/images/favicon.png" type="image/png"> but when I start the dev server and open page in browser I get this instead in the href attribute data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAA… RHf7T5+kcoOj13A0fAeYfXiVAltLHyZcAAAAASUVORK5CYII= Now this works as the favicon is shown no issue, but then say I change the favicon with another image with same name, then the browser keeps showing the old one no matter what I do (refresh, hard refresh, disable cache, delete entirety of cache ...). What bothers me more is that I have different profiles in my chrome browser, and in all of them it shows the newer version and href is actually as is (/static/images/favicon.png) while only on one it keeps showing that data:image value that points to the old image :))), any ideas friends and Thanks!
3 Replies
StefanH
StefanH3mo ago
1: what dev server are you running? Is this a vite app? Are you using react or vue? More context to your tooling is needed 2: Looks like the dev server is replacing your favicon with a inline svg which seems like a reasonable way to speed up load times since you dont need to wait for a separate request to finish 3: Full code blocks please not just out of context snippets 4: Don't really understand what you're trying to say. Your favicon does not change in your browser when you update the file? Again more context to your tooling is needed to understand what might be happening
rzcommader
rzcommaderOP3mo ago
I am working with Django in the backend and using vite for server side rendering, so not using neather react or vue, only Django Template System, as for the code I simply use this <link rel="icon" href="{% static "images/favicon.png" %}"type="image/png"> And thus in development when for example I use image A which is named favicon.png it works, but then when I decide to change to image B which I name too favicon.png (thus overriding image A from images folder) the browser still keeps showing off the old image as that form, unfortunately this happens only with one profile user in google chrome, otherwise for rest of profiles of chrome in same pc everything works totally fine and the favicon is each and everytime requested from the server as I checked in the network tab, unlike the other profile where favicon as shown in network tab is served as that URI fomat from disk
curiousmissfox
curiousmissfox3mo ago
Try changing the name of the file for Image B ( faviconB.png ), or changing the path. Image A images/dev/favicon.png Image B images/prod/favicon.png `

Did you find this page helpful?