You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by David Hubbard <dh...@dino.hostasaurus.com> on 2006/02/24 22:48:19 UTC

[users@httpd] 404 error byte logging

Hi all, sorry if this has been asked before, couldn't find
it in the archives.  I was curious about why Apache logs
the bytes of the 404 error document to a 404 request in the
log when that is only actually accurate for 404's involving
pages that the browser actually accepts the error document?
For example, if I have a page with 5 bad images on
it and my error document is 50 kilobytes in size, the log
will reflect 50 kilobytes transferred on the 404 request
for each of the five bad images when a sniffer shows my
machine received nothing more than a kilobyte or two of
http traffic from the http conversation while determining
those images were bad and that it didn't have anything to
display.  If I requested a missing html page, yes, I'd get
the whole 50 kilobyte error document but not in the case of
content that would not display the error document.  

Is there a way around this?  Other than telling customers
to write better html code that doesn't cause 404's? :-)

Thanks,

David

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] 404 error byte logging

Posted by Joshua Slive <jo...@slive.ca>.
On 2/24/06, David Hubbard <dh...@dino.hostasaurus.com> wrote:
> Hi all, sorry if this has been asked before, couldn't find
> it in the archives.  I was curious about why Apache logs
> the bytes of the 404 error document to a 404 request in the
> log when that is only actually accurate for 404's involving
> pages that the browser actually accepts the error document?
> For example, if I have a page with 5 bad images on
> it and my error document is 50 kilobytes in size, the log
> will reflect 50 kilobytes transferred on the 404 request
> for each of the five bad images when a sniffer shows my
> machine received nothing more than a kilobyte or two of
> http traffic from the http conversation while determining
> those images were bad and that it didn't have anything to
> display.  If I requested a missing html page, yes, I'd get
> the whole 50 kilobyte error document but not in the case of
> content that would not display the error document.
>
> Is there a way around this?  Other than telling customers
> to write better html code that doesn't cause 404's? :-)

The ErrorDocument is sent every time the 404 error occurs.  It is just
that in some cases (embedded images, for example), the browser throws
away the content.

If you are worried about this and don't want to fix your documents,
you can set the ErrorDocument for images to somthing smaller, as in
<FilesMatch \.gif$>
ErrorDocument 404 "Not Found"
</FilesMatch>

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org