1. #1
    Ext User
    Join Date
    Aug 2009
    Posts
    127
    Vote Rating
    0
    rblon is on a distinguished road

      0  

    Default high #http-requests slows down (mainly s.gif)

    high #http-requests slows down (mainly s.gif)


    Browser: FireFox/3.5.3 & Google Chrome/3.0.195.21
    Webserver: lighttpd/1.4.23 & Apache/2.2.13

    Hi,

    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.

  2. #2
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,502
    Vote Rating
    48
    Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    Shouldn't be any requests for that now from the better browsers. By default it is a data URL.

  3. #3
    Ext User
    Join Date
    Aug 2009
    Posts
    127
    Vote Rating
    0
    rblon is on a distinguished road

      0  

    Default


    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/3.0.195.21: 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.

  4. #4
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,502
    Vote Rating
    48
    Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    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

  5. #5
    Ext User
    Join Date
    Aug 2009
    Posts
    127
    Vote Rating
    0
    rblon is on a distinguished road

      0  

    Default


    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]
    Attached Files

  6. #6
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,502
    Vote Rating
    48
    Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    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.

  7. #7
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    91
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    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.

  8. #8
    Ext User
    Join Date
    Aug 2009
    Posts
    127
    Vote Rating
    0
    rblon is on a distinguished road

      0  

    Default


    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)

  9. #9
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    91
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    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?

  10. #10
    Ext User
    Join Date
    Aug 2009
    Posts
    127
    Vote Rating
    0
    rblon is on a distinguished road

      0  

    Default


    Hi Condor,

    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
    Cache-Control max-age=604800
    Content-Type image/gif
    Accept-Ranges bytes
    Etag "1314839837"
    Last-Modified Mon, 06 Jul 2009 23:09:20 GMT
    Content-Length 43
    Date Wed, 23 Sep 2009 12:59:08 GMT
    Server lighttpd/1.4.23

    and this the request header

    Host dev.example.com
    User-Agent Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3
    Accept image/png,image/*;q=0.8,*/*;q=0.5
    Accept-Language en-gb,en;q=0.5
    Accept-Encoding gzip,deflate
    Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7
    Keep-Alive 300
    Connection keep-alive
    Referer http://dev.example.com/extjs/example...two-trees.html
    Pragma no-cache
    Cache-Control no-cache