high #http-requests slows down (mainly s.gif)
Browser: FireFox/3.5.3 & Google Chrome/184.108.40.206
Webserver: lighttpd/1.4.23 & Apache/2.2.13
I am designing a front-end for a web-application and started with the portal template. At the moment I have two tree menu's and couple of grids, which are filled with static data from json files at load time. However, loading the page takes around 5 seconds, which I consider pretty poor as there is (almost) no network latency.
I had a look at the server access log and notice that loading leads to around 160 requests, and 100 of them are for "s.gif". Using Chrome instead of FireFox leads to a much better performance, as in that case there are only a few "s.gif" request.
A similar behaviour can be observed in the "./examples/tree/two-trees.html" sample, where I see around 50 request, with more than 30 for "s.gif".
Even though there are >150 simultaneous requests, 5 seconds still seems very slow, which I thought indicated a web server problem. However, I have tried both lighttpd and Apache, and I observe similar loading times
I have two questions:
* Is such a high number of requests a known "issue"? It appears browser specific, but I was wondering if there any methods to bring it down (100+ "s.gif requests doesn't seem efficient...)
* Any views on what are other reasons for slow loading times? The two-trees sample loads slow as well in my opinion, so perhaps we can discuss using that example.
Shouldn't be any requests for that now from the better browsers. By default it is a data URL.
ok, but lets take "./examples/tree/two-trees.html" as example.
On the serverside I am running lighttpd under FreeBSD (don't think that matters though).
I see the following on reloading (shift-reload button):
Win XP with FireFox/3.5.3: 52 requests, 37 for s.gif
Win XP with Chrome/220.127.116.11: 14 requests, 2 for s.gif
Win XP with IE/8.0: 15 requests, 3 for s.gif
Win XP with Safari/4.0.3: 29 requests, 5 for s.gif
Mac OS X 10.6.1 with FireFox/3.5.3: 60 requests, 41 for s.gif
Mac OS X 10.6.1 with Safari/4.0.3: 8 requests, 1 for s.gif
These numbers are non-producable, i.e. they change every time I do a re-load, but it does suggest a FireFox issue (and less severe Safari for Windows).
I would consider an up-to-date FireFox in general one of the "better browsers", so I am wondering if other people observe something similar.
Also, on second thoughts, I do think this offers some explanation for slow load time. Because even though the server might be able to handle >1000 requests per second, the browser will request them sequentially.
Any one page should only request an image once however many times it is used on a page. This is what happens:
As you see, only one request for s.gif
can I ask what browser & debug tool you are using? I see in Firebug only XHR requests (or I don't how to see all requests).
below my lighttpd access.log, which is showing all s.gif requests (I have changed my domain to example.com before pasting). It might be an issue with logging, but my first impression is that these requests actually take place
[I have attached now the log file instead of copy-pasting it]
That's Firebug. The Net tab has a series of buttons to select which network requests to show. You see them along the top in that picture. I have "All" clicked.
You should configure your HTTP server to send an Expires header for images (and probably also for all other static resources).
ps. Try running YSlow for your webpage.
Animal, i have tried Firebug - net tab, and I am seeing many "s.gif" requests. Both under Win XP as Mac OS X. So same observation as lighttpd access logs.
Condor, I have mapped in lighttpd ".gif" to "image/gif", which seems to work (in Firebug I see Content-Type image/gif in Response Header for GET s.gif request)
I am going to give now YSlow a go (haven't used it before)
Did you configure an expires header as I suggest? (see here for instructions).
ps. I bulk-approved all your messages. Could you delete the duplicates?
I have added "mod_expire" to lighttpd, but still see many "s.gif" requests
This is a response header
Expires Wed, 30 Sep 2009 12:59:08 GMT
Last-Modified Mon, 06 Jul 2009 23:09:20 GMT
Date Wed, 23 Sep 2009 12:59:08 GMT
and this the request header
User-Agent Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:18.104.22.168) Gecko/20090824 Firefox/3.5.3