Load the page twice?

37 views
Skip to first unread message

mase

unread,
Apr 11, 2007, 7:20:01 PM4/11/07
to Firebug
When FireBug is enabled, does load each page twice? Looking to nail
down discrepancies between different page views, ad impressions and
other numbers.

It seems that when FireBug is enabled it increments our db log counts
by 2! But when it's disabled only 1.

Just looking to confirm/deny my suspicions.
Thanks

John J Barton

unread,
Apr 12, 2007, 12:42:18 AM4/12/07
to Firebug
Firebug gets the source it shows by code like this:
---
var ioService = IOService.getService(nsIIOService);

var channel = ioService.newChannel(url, null, null);
channel.loadFlags |= LOAD_FROM_CACHE |
LOAD_BYPASS_LOCAL_CACHE_IF_BUSY;
---
Then it caches the result separate from the browser's cache.

I guess this results in the following:
-- For pages that the browser decides to cache: 1 GET, the browser
-- For pages that the browser decides not to cache: 2 GETs, browser
+firebug
I don't understand the second flag...IF_BUSY.

Experimentally I get different results in different cases.
Here I am watching the (incredibly dumb file) server:

For simple html, 1 GET for HTML
For <script src=file.js> 1 GET for HTML, one for JS.
For AJAX 2 GET for HTML, one for AJAX (that one is my call, not
firebug).

In each case, reloading the page gives identical results, except
that the browser adds Cache-Control= max-age=0 header.

There are a lot of posts on this group to the effect that Firebug
either causes too many or too few loads. My first guess is that the
confusion comes from different caching info sent from the server and
possibly by browser cache policy. For example, I can't explain
why the AJAX case loads html twice.

Reply all
Reply to author
Forward
0 new messages