Firebug shows some requests in Gray

2020-07-11 06:44发布

问题:

Firebug shows some requests in Gray(screenshot attached and marked in Red) with status code 200 and some requests shows black with status code 200. What is the difference between two requests?

回答1:

The gray requests are the ones loaded from the cache, as described in a feature-promo here:

http://getfirebug.com/network

Cached or not cached

Not all network requests are equal - some of them are loaded from the browser cache instead of the network. Firebug provides status codes for every request so you can quickly scan and see how effectively your site is using the cache to optimize page load times.

Edit As for your concern regarding 200-codes and 304 codes, they also display this image on their website next to the above quote.

In other words, it would seem as if 200 still means that it is loaded from the cache. I do agree that it's a bit strange. I'm trying to uncover more details.

Edit 2 I would assume that the server sends out 200-codes, but the browser chooses to ignore them and run the cached content anyway (perhaps by assuming it didn't change, or perhaps because the new page loaded is in the same directory as the old one?).



回答2:

I'm citing Jan Honza Odvarko, firebug lead developer, from the actual firebug google group:

1) Requests displayed in Gray (with status code == 304) represents cases where the response is coming from the browser cache.

2) Requests displayed in black (with status code == 200) represents cases where the response is coming from the server (not cached)

3) Requests displayed in gray with special background (whatever status code) come from BFCache, see: http://www.softwareishard.com/blog/firebug/firebug-tip-what-the-heck-is-bfcache/ (the background has been introduced in Firebug 1.10)