|
Http speed requests multiple charts. |
Posted by Jorge Eduardo on Apr-03-2014 22:37 |
|
Hi Peter, in order to speed up a dashboard that has many charts, I need to reduce the
amount of requests and/or the time each request takes. Having in mind that my
dashboard has at least 10 charts and each one spends 300 ms.
Do you know of any approach to reduce download time? for example something like using
css sprites, or anything.
Thanks in advance, Jorge Eduardo
|
Re: Http speed requests multiple charts. |
Posted by Peter Kwan on Apr-04-2014 01:58 |
|
Hi Jorge,
For the charts in your image, each chart should take around 30ms to generate. This mainly
depends on the CPU speed. If you are on a server on which the CPU is always busy or is
slow, then of course this will take longer.
As your application is a web application, there are also overhead related to your web server
and the network delay. The network delay depends on many factors and can be very small
or very large.
If the slow speed is really due to network delay, using CSS sprites can help to reduce the
total delay. The CSS sprites method basically use one big HTTP request instead of 10 HTTP
requests for the 10 images. This can improve total delay because there is less protocol
handshake required to set up 1 HTTP request compared to 10 HTTP requests.
However, the CSS sprites method will increase the delay to see the first chart. It is
because with CSS sprites, you can only display the charts when all of them has reached the
browser. On the other hand, if each chart is on a separate HTTP requests, you can see the
charts as they are loaded. That's why in many applications, people may not prefer to use
CSS sprites. In fact, sometimes the opposite is done - to divide a big image into multiple
small images (like in Google Map), so that the user can see parts of the image sooner.
If you would like to use the CSS sprites method, you can use the MultiChart object in
ChartDirector to combine all the charts into one big chart image. On the browser side, you
can write HTML code to separate them into 10 charts.
Regards
Peter Kwan |
|