4 ms·
Although I can't stop the requests from being sent, a standard line I add into all my nginx confs to at least minimize my logfiles: location = /favicon.ico { a
by kitcar 12y ago
Although I can't stop the requests from being sent, a standard line I add into all my nginx confs to at least minimize my logfiles:
location = /favicon.ico { access_log off; log_not_found off; }
- byuu 12y agoUnfortunately, even by disabling the logging, browsers like Chrome will keep wasting your server's resources asking for it if you return a 404. I know it's not going to overwhelm anyone's servers alone, but if you ever get a massive traffic surge that starts causing some visitor requests to fail, you'll probably enjoy having one less socket request per visitor. I add <link rel="icon" href="data:;base64,iVBORw0KGgo="> into my HTML head section. I don't recall offhand if it stops the initial request in all browsers, but it does at least prevent repeated requests. Most people would just tell you to drop a blank favicon.ico if you really don't want a site icon (and I don't), but I'm not going to clutter up my root directory with junk (this, two Apple icon files, and whatever else people decide to do in the future.)