Disabling favicon errors

William Muriithi william.muriithi-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org
Wed Mar 18 17:55:20 UTC 2009


Ian & William,

>
> I take a different tack with this problem - I generate a favicon with
> "touch" in each web root.  Apache serves a 0 byte file pretty quickly,
> there are no errors to log, and everybody is happy.  If there is a
> favicon in place it is unperturbed, but if it didn't exist it does now.

I came across a different approach the other day and thought it was a
far better resource usage. Basically, it avoid any IO generation as
apache start up fully aware its not supposed to serve any file by the
name favicon. The client benefit by receiving a more correct response
- no favicon is available.

These are the changes one need, just in case one is interested.

Redirect 404 /favicon.ico

<Location /favicon.ico>
    ErrorDocument 404 "No favicon
</Location>

Inform apache to send an error response and not bother looking for the
file on the HD. Also, save on the HD activity that would have been
generated writing to error.log

SetEnvIf Request_URI "^/(favicon\.ico)$" dontlog

Prevent logging to access.log

With above two changes, favicon generate zero hard disk activity.

William

>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
>
> iD8DBQFJg7MaHQtmiuz+KT8RAjO/AKCScNGPXJd19MpnGawK5x2KE8PUVQCfbAny
> lmr0pGOFZIsPidbKUfMDS7I=
> =XU3T
> -----END PGP SIGNATURE-----
>
>



-- 
For a list of all the ways technology has failed to improve the
quality of life, please press three.
—Alice Kahn
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list