-2

enter image description here

  • Response comes from cache
  • HTTP code 304 (regardless, if response comes from cache, or server)
  • Something else

EDIT: Changed title and screen to clarify what I mean with "gray lines".

Kara
  • 5,650
  • 15
  • 48
  • 55

2 Answers2

3

I have been experimenting with this all day as I had issues with browser cache in my Web application.

From what I saw the HTTP status code is always displayed in gray when it is 304. However, IE is kinda stupid because this can mean 2 distinct things that are not easily distinguishable in the developer tools:

  • The browser made a request to the server which replied with a 304 Not Modified response
  • The browser didn't make a request as it determined that the copy in the cache was still valid, and it directly used the cached result

In the second case, you can't trust what is displayed in the detailed view as the request and response headers+contents are then made up of data stored in the cache, not from an actual request. Specifically, if there is an Expires header in the "Response headers" tab, it is actually calculated from the cached data (could be calculated from a Cache-Control: max-age=xx header for example, and the Cache-Control header will not appear in the list)

I think you can distinguish the 2 cases: it seems that when the "Taken" time is "<1ms" it is very likely the cache was used. If it's anything else it's likely that an actual request was made.

The above part is wrong, ignore it.

Other browsers like Firefox and Chrome do it properly in their developer tools: requests handled using only the browser cache are annotated "From cache".

I hope this could help you as I have lost several hours trying to figure out what IE was doing. This information is only deducted from my observations using IE 9 with default settings, a local JBoss webserver, and the phenomenon was seen with any HTTP request for static files: JS, CSS... Images don't seem to appear in the developer tools again when they have been loaded once (session cache ?)

For general information about browser caching I recommend this read: http://www.f5.com/pdf/white-papers/browser-behavior-wp.pdf

Edit: I found another topic discussing this here. It confirms what I have noticed by myself.

Community
  • 1
  • 1
Floflo
  • 31
  • 3
  • Hi, and welcome to SO! To summarize your answer: gray = Server response with HTTP 304 **or** response from cache. Correct? Do you have a reference, or are these your observations of the IE behavior? – ulrichb Dec 04 '12 at 18:07
  • @ulrichb That's what I meant. This is only from my observations made during my work yesterday. I couldn't find anything about that on the Web, except this thread I tumbled upon by chance. The part about the "Taken" time is false however. There are times when it says "<1ms" even if there was an actual request to the server (I tested with a localhost server so very low ping). – Floflo Dec 05 '12 at 15:04
  • @ulrichb Thanks for the welcome. I have often used Stack Overflow to look for solutions to common programming problems, but it's the first time I actually contribute. Note that I edited my answer above. – Floflo Dec 05 '12 at 15:23
  • OK, I did already a +1 :) ... Many thanks for sharing your observations with us. – ulrichb Dec 05 '12 at 16:54
1

HTTP Error 304 - Not modified

This does not really indicate an error, but rather indicates that the resource for the requested URL has not changed since last accessed or cached. The 304 status code should only be returned if allowed by the client (e.g. your Web browser). The client specifies this in the HTTP data stream sent to the Web server e.g. via If_Modified_Since headers in the request.

Systems that cache or index Web resources (such as search engines) often use the 304 response to determine if the information they previously gathered for a particular URL is now out-of-date.

More Info: HTTP Error 304 - Not modified

Community
  • 1
  • 1
Praveen Kumar Purushothaman
  • 154,660
  • 22
  • 177
  • 226
  • OK. Nice, that you explain the meaning of 304 to us. BUT: Any references, that the gray lines *in the IE DT* just indicate 304 (regardless, if response comes from cache, or server). – ulrichb Nov 24 '12 at 18:16
  • Gray lines? Do you mean the grid? It is the table to display it. BTW, what is the reason for the downvote? – Praveen Kumar Purushothaman Nov 25 '12 at 04:01
  • Gray colour 304 says that it is not fetched from the Server! – Praveen Kumar Purushothaman Nov 25 '12 at 04:04
  • Firstly, yes, gray lines in the DT network grid (please take a look at the marked areas in the screen). Secondly, down-vote, because you cannot provide a reference for your claim, you just explained what Http 304 means. Not an answer to my question. So, please improve or delete your answer. – ulrichb Nov 25 '12 at 17:36
  • BTW, you just contradicted your answer with your second comment (gray = HTTP 304 vs. gray = from cache). – ulrichb Nov 30 '12 at 10:47
  • @ulrichb I say the same thing. The one, which not modified from the server response, will be gray. So, HTTP 304, which is not modified from the last fetch, i.e., served from the cache, is gray! – Praveen Kumar Purushothaman Nov 30 '12 at 13:03