Improving the performance of your charts

Share RGraph:   Share or Like RGraph on Facebook!

Although performance is excellent, (eg compared to server based charts libraries), you may still want to tune RGraph further. The biggest thing you can do is use HTTP compression, which reduces the initial download time of the libraries, but there are a number of things you can do:


A reasonable performance strategy

Although there's a lot you can do in regards to performance, a few of the points here will suffice for most websites:

The number one thing you should do is compress your libraries. This has multiple benefits and provides by far the most gain, effectively for free. Secondly, use the minified libraries. Since you can download the minified libraries here, you might as well use them. Then we have pre-emptive caching. Since most websites won't show charts on the front page or will have a login page that is shown before any charts, this effectively eliminates the charts library download. And lastly caching should be done as a matter of course. There's no reason to keep downloading the same library so even caching for only 30 minutes (or the duration of an average visit to your website) will produce results.


General website performance tools

If your aim is to improve your websites performance as a whole then you may be interested in these tools:

Note about performance and HTTP/2

As of 2016 HTTP/2 will become more widespread - with many people planning to make the switch to it - and this includes many hosting providers. Patterns such as domain sharding (using multiple hostnames) and concatenating your JavaScript libraries together become anti-patterns and are less useful and in some cases actually hurt performance. If you're planning to switch to HTTP/2 or already have then you should compare the advantages of some of these techiques versus not using them and determine what, if any, the benefit is. Again, in some cases the use of some of these techniques may not help at all and may even hurt performance.