MENU
.net Powerful JavaScript charts
About
RGraph is a JavaScript charts library based on HTML5 SVG and canvas. RGraph is mature (over 18 years old) and has a wealth of features making it an ideal choice to use for showing charts on your website.

More »

 

Version 7.10 released
Version 7.10 (released in January 2026) is the latest version of RGraph and contains various updates to the code which you can see on the changelog page. There's also a big tidy up in terms of comments and a significant change to the way that the internal code is referenced which should lead to a performance improvement in effects and animations.

Download »

 

New HTML datagrid
In the April 2025 (v6.21) release a new datagrid object was added. This makes it easy to add static or dynamic data tables to your pages. It can be used whether you use the canvas or SVG libraries or entirely standalone.

Read more »

 

Download
Get the latest version of RGraph (version 7.10, 18th January 2026) from the download page. You can read the changelog here. There's also older versions available, minified files and links to cdnjs.com hosted libraries.

Download »

 

License
RGraph can be used for free under the GPL or if that doesn't suit your situation there's an inexpensive (£129) commercial license available.

More »

Converting dynamic pages to static for better performance and... Happy Christmas!

Written by Richard Heyes, RGraph author, on 22nd December 2025

In my never-ending quest to get the best performance possible out of the website, many of the pages' output is now cached on the server. This output is then used, if it exists, in place of the dynamic page. So what you're loading is just a static HTML page instead of a dynamic server-built page (not that there was a lot involved in the building anyway).

There's an admin panel behind the scenes that calls the dynamic page, takes the resulting HTML and then writes that HTML to a file. When you load the page in your browser, that file is used, if it exists, in favour of the original script, so you're loading the static file instead of the original script.

The admin panel that loads the original script and then writes the HTML to a file was simple enough to build and then there was a bit of Apache configuration that had to go in a .htaccess file that makes the server use the static HTML file instead of the original script, and that looks like this:

##
## Rules to make Apache use static content if it exists in favour
## of the original script.
##

# This makes the rewrite conditional on the static file existing.
RewriteCond %{REQUEST_FILENAME}.static -f

# The rewrite rule which tells Apache to use the static version of
#  the file if it exists.
RewriteRule (.*).html$ /$1.html.static [L]

# This block matches the .static files that have been generated by
# the admin panel and saved alongside the original script.
<filesMatch "\.html\.static$" >

    # Add a Cache-Control header to the output that makes the user's
    # browser cache the page
    header set "Cache-Control" "public, private, max-age=604800"

    # Make the HTML page completely static and not use server-side
    # scripting for maximum speed
    RemoveHandler .html
</FilesMatch>

So there's not much in the way of configuration involved in trying to attain the best possible performance. Obviously, this solution would not fit a fully dynamic site - something as simple as a logged-in users name in the top right of the page would make a dynamic page necessary - though you could cook something up where the main page is static but the "logged-in" bit of the page (which might state the users name for example) is done by an AJAX script (which, obviously, wouldn't be static).

And since we're a few days away from Christmas, I'd better say the obligatory "Happy Christmas"! If you're celebrating it then have a great time and if not - then don't worry too much about it! Just enjoy the time off work if you have it. :-)