slagyr/joodo — pull request #8 by trptcolin (2012-10-19 17:10:14+00:00)
Title: Create favicon-responding middleware

By the time the request handlers get down to the Ring middleware stack, we're already past the point where static assets would have been served (that's in `joodo.kake.StaticFileFilter.java`).

This patch makes any GET request to /favicon.ico respond immediately with a 404, rather than going through all of the routing, logging, and other middlewares that are currently being run on such requests.

So it should give a bit of a performance boost depending on what all middlewares are being used, and it also avoids extra logging that can be noisy when trying to debug things.

The only place I can imagine this going wrong would be if an app needed to dynamically specify the favicon based on clojure application logic. And that seems unlikely.