Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #13259

Re: totally WEIRD bug? Firefox caching?

From Arno Welzel <usenet@arnowelzel.de>
Newsgroups comp.lang.php
Subject Re: totally WEIRD bug? Firefox caching?
Date 2014-03-21 08:33 +0100
Message-ID <532BEB3F.4090300@arnowelzel.de> (permalink)
References <lgcjv5$16v$1@news.albasani.net> <532AB145.8080504@arnowelzel.de> <lgej8o$lsi$1@news.albasani.net> <532B00FC.8@arnowelzel.de> <lgfcke$9p0$1@news.albasani.net>

Show all headers | View raw


The Natural Philosopher, 2014-03-20 19:39:

> On 20/03/14 14:53, Arno Welzel wrote:
>> Am 20.03.2014 12:26, schrieb The Natural Philosopher:
>>
>>> On 20/03/14 09:13, Arno Welzel wrote:
>>>> Am 19.03.2014 18:25, schrieb The Natural Philosopher:
>>>>
>>>>> I have TWO IDENTICAL PHP  FILES.
>>>>>
>>>>> They are supposed to display an image got from a database.
>>>>>
>>>>> One does. The other does not.
>>>>>
>>>>> It persistently tells me the image is corrupted.
>>>>>
>>>>> I have even copied one file that works directly over the other. It still
>>>>> doesn't work.
>> [...]
>>> What is happning - and oddly running it against a test version of IE6 in
>>> my XP VM showed it up, was that it was outputting a '404 file not found'
>>> text BEFORE outputting perfectly valid PNG.
>>>
>>> Why this is happening is a bug somewhere else completely.
>>>
>>> IE 6 simply showed the text and the binary gobbledygook which was the
>>> clue I needed.
>>
>> Yes, because IE 6 assumes the user may not understand a server generated
>> error message and shows its own message as long as the reponse is below
>> a certain size limit (AFAIR less than 4000 bytes, but i may not remember
>> correctly). This is even more annoying - sometimes you see the message
>> from IE itself and sometimes
>>
>>> How this has happened will take me some time to understand because the
>>> line that says '404 not found' is followed  - or I thought it was - by
>>> an exit(); statement.
>>>
>>>> Either Firefox once got an invalid image and cached the response or the
>>>> server does not respond the way you think. Maybe a BOM in the PHP file?
>>>> This may not be visible in your editor, but it can cause all sort of
>>>> problems.
>>>>
>>>>
>>> Firefox makes it hard to debug because it DOES cache bad results: I
>>> usually fix that by sending random nonsensical GET parameters which are
>>> ignored to ensure it thinks its a different URL each time.
>>>
>>> It a huge minus against firefox that it didn't - even using the
>>> debugging console - show me what was really going on, whereas IE6 did.
>>
>> You should learn to read HTTP response headers in the developer console
>> of Firefox. When I open <http://arnowelzel.de/wiki/en/tools/rwinfo>
>> there the developer console of Firefox tells me EXACTLY what is going on:
>>
>> 1) The server responded with a status code 404 (not found)
>>
> 
> The problem is that it didn't send an error code in the header
> It sent a valid header, the some error text, and then the PNG

In this case you can't blame Firefox - Firefox behaved correctly. It got
a response but WITHOUT status 404. So it cached the response and
displayed the result. Even though the result was not a valid image -
it's not the fault of Firefox when the server sends garbish and declares
that garbish to be a PNG image without any hint that something went
wrong (HTTP status 4xx or 5xx etc.).

On the other hand it looks like IE6 handled the response from the server
as HTML even though a MIME header was present that clearly states the
content is an image.

Well - in that particular case it may helped to find the problem. But
technically IE6 is broken anyway. I assume IE6 did not see a ".png" etc.
in the URL and since the response contained some text which *may* be
HTML (or text) it decided to treat the content as HTML (or text) and
just ignore the MIME-Type in the header.

And finally - neither Firefox nor IE6 are debugging tools - they are
browsers. But Firefox still offers many helpful tools to find errors,
where IE6 doesn't.


-- 
Arno Welzel
http://arnowelzel.de
http://de-rec-fahrrad.de
http://fahrradzukunft.de

Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

totally WEIRD bug? Firefox caching? The Natural Philosopher <tnp@invalid.invalid> - 2014-03-19 17:25 +0000
  Re: totally WEIRD bug? Firefox caching? "J.O. Aho" <user@example.net> - 2014-03-19 20:06 +0100
    Re: totally WEIRD bug? Firefox caching? Robert Heller <heller@deepsoft.com> - 2014-03-19 14:32 -0500
      Re: totally WEIRD bug? Firefox caching? The Natural Philosopher <tnp@invalid.invalid> - 2014-03-19 23:42 +0000
    Re: totally WEIRD bug? Firefox caching? The Natural Philosopher <tnp@invalid.invalid> - 2014-03-19 23:42 +0000
  Re: totally WEIRD bug? Firefox caching? Gabe <usenet@moojuice.net> - 2014-03-19 21:39 +0000
    Re: totally WEIRD bug? Firefox caching? The Natural Philosopher <tnp@invalid.invalid> - 2014-03-19 23:43 +0000
      Re: totally WEIRD bug? Firefox caching? Gabe <usenet@moojuice.net> - 2014-03-20 08:29 +0000
  Re: totally WEIRD bug? Firefox caching? Richard Yates <richard@yatesguitar.com> - 2014-03-19 18:34 -0700
    Re: totally WEIRD bug? Firefox caching? The Natural Philosopher <tnp@invalid.invalid> - 2014-03-20 03:10 +0000
      Re: totally WEIRD bug? Firefox caching? Richard Yates <richard@yatesguitar.com> - 2014-03-19 21:26 -0700
        Re: totally WEIRD bug? Firefox caching? The Natural Philosopher <tnp@invalid.invalid> - 2014-03-20 11:13 +0000
  Re: totally WEIRD bug? Firefox caching? Arno Welzel <usenet@arnowelzel.de> - 2014-03-20 10:13 +0100
    Re: totally WEIRD bug? Firefox caching? The Natural Philosopher <tnp@invalid.invalid> - 2014-03-20 11:26 +0000
      Re: totally WEIRD bug? Firefox caching? Jerry Stuckle <jstucklex@attglobal.net> - 2014-03-20 08:43 -0400
      Re: totally WEIRD bug? Firefox caching? Arno Welzel <usenet@arnowelzel.de> - 2014-03-20 15:53 +0100
        Re: totally WEIRD bug? Firefox caching? The Natural Philosopher <tnp@invalid.invalid> - 2014-03-20 18:39 +0000
          Re: totally WEIRD bug? Firefox caching? Arno Welzel <usenet@arnowelzel.de> - 2014-03-21 08:33 +0100
          Re: totally WEIRD bug? Firefox caching? Nisse Engström <news.NOSPAM.uvex6@luden.se> - 2014-03-22 07:24 +0100
            Re: totally WEIRD bug? Firefox caching? The Natural Philosopher <tnp@invalid.invalid> - 2014-03-22 12:10 +0000
              Re: totally WEIRD bug? Firefox caching? Robert Heller <heller@deepsoft.com> - 2014-03-22 10:48 -0500
                Re: totally WEIRD bug? Firefox caching? Doug Miller <doug_at_milmac_dot_com@example.com> - 2014-03-22 18:08 +0000

csiph-web