← blogs.sussex.ac.uk

Things we love about moodle2 pt1 – minify, gzip & exclude

In moodle 1.9 we spent a lot of time optimising the page load speeds and improving the quality of our code.

Using tools including:

allowed us to analyses what was slowing pages down, and how to improve this.

1. Minify and compress

Moodle2 comes with built in minify and gzipping for css and javascript!

2. Load things in the right place

Moodle2 theme config.php allows us to load javascript in the footer of the page instead of the header :
$THEME->javascripts_footer = array();

3. Don’t load things you don’t need

Moodle2 allows us to exclude parent theme css and javascript :

$THEME->parents_exclude_javascripts = array();
$THEME->parents_exclude_sheets = array();

Minifying javascript can create some interesting results, so the fact that the moodle2 team thought about and managed to do this is very much appreciated.

For anyone interested in speeding up their site – the best practice guidelines by yahoo & google (along with the tools above) can be an interesting insight into improving things for your users, and making your code better.

So far, we are just evaluating a test install of moodle2, but will be updating the blog with further findings.

2 Comments