Kurt McKee

lessons learned in production


Handling automatic favicon requests

Posted 17 December 2019 in website

Favicons. I know that they were groundbreaking when they first sprang into existence and use, but I barely remember those days anymore (that was 20 years ago!). But now my server logs are filling up with HTTP 404 errors because I haven't created and placed a favicon.ico file at the root of the site.

To resolve this problem, I created an additional directive in my server configuration. Now, all requests for favicon.ico immediately return HTTP 204 No Content. "Yes, I got your request. No, I have no content for you to display."

I'll eventually add a favicon, but for now I've resolved the 404 errors that are caused by these automatic requests.

☕ Like my work? I accept tips!