Forum Moderators: phranque

Message Too Old, No Replies

http status codes - 200 206 and finally 200 - is this normal?

         

konrad

4:23 pm on Nov 17, 2006 (gmt 0)

10+ Year Member



Hello. Forgive me my English.

From time to time I receive e-mails from Users unable do download stuff from my website (they're trying to download exe files - software applications)

After analyzing logs I discovered these strange results:

1. One of the Users (identified by his IP) was trying to download a 1 MB file, this is an excerpt from log file (time ,response code, downloaded bytes) :
05:00, 200, 65536
05:01, 200, 131072
05:02, 206, 131072
05:03, 200, 131072
And he's saying he did not abort downloading.

First, code 206 (partial content) - if everything was fine, then isn't it true, that the whole process of downloading should be full of 206 codes, in this case (downloading piece after piece, like some programs do)?
And, that in this case, there should be no 200 codes? Doesn't 200 mean: download the entire file? What can be the cause of these strange string of response codes?

2. Analyzing another user brought this:
05:24, 304, and no info about downloaded bytes. Agent: "avant browser".

304: Not Modified. I thought, that this response code may be returned only if the browser (in this case 'avant') has already this file in cache and asks my server: do you have a newer file? The problem is, that was the first time this User tried to download this file, so the server should not return 304, am I right? If not, then in what scenario can the 304 code be returned? (Google did not help me with this).

And there is another problem, maybe related to the above: sometimes a browser (tested with firefox/IE) wants do _download_ php files from my server (eg. phpbb forum's index.php). Just like it was not php/html file, but rather exe, doc, mpg or something like that.

Can somebody please throw light on this before I'll contact the company responsible for my server?

jdMorgan

5:20 pm on Nov 17, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Incorrect cache-control and MIME-type settings might result in these problems.

If you don't send correct cache-control headers, your content may be cached not only in the user's browser, but also by any intervening network caches, used by some major ISPs like EarthLink, AOL, and others, as well as by corporations.

If you send a php-generated page with a MIME-type of "application/php" instead of "text/html" then the browser will try to download it or display it as raw data instead of rendering it on the screen as an HTML page.

Your problem is likely a combination of configuration errors or omissions, and is therefore complex. So the above is all I can offer.

You can check your server's responses and look at the MIME-type and cache-control headers (and others) using the "Live HTTP Headers" extension for FireFox -- both free at mozilla.org.

Jim

konrad

8:58 pm on Nov 17, 2006 (gmt 0)

10+ Year Member



OK, thanks, I'll look at this tool, although the problem is that it happens from time to time... it looks like this will be a long investigation :)