{"id":437,"date":"2011-01-17T11:41:43","date_gmt":"2011-01-17T11:41:43","guid":{"rendered":"http:\/\/blogs.sussex.ac.uk\/elearningteam\/?p=437"},"modified":"2011-10-17T14:21:01","modified_gmt":"2011-10-17T14:21:01","slug":"things-we-love-about-moodle2-pt1-minify-gzip-excude","status":"publish","type":"post","link":"https:\/\/blogs.sussex.ac.uk\/elearningteam\/2011\/01\/17\/things-we-love-about-moodle2-pt1-minify-gzip-excude\/","title":{"rendered":"Things we love about moodle2 pt1 &#8211; minify, gzip &amp; exclude"},"content":{"rendered":"<p>In moodle 1.9 we spent a lot of time optimising the page load speeds and improving the\u00a0quality\u00a0of our code.<\/p>\n<p>Using tools including:<\/p>\n<ul>\n<li><img loading=\"lazy\" class=\"size-full wp-image-443\" title=\"firebug\" src=\"http:\/\/blogs.sussex.ac.uk\/elearningteam\/files\/2011\/01\/firebug1.png\" alt=\"\" width=\"32\" height=\"32\" \/> <a href=\"http:\/\/getfirebug.com\/\" target=\"_blank\">Firebug<\/a> for Firefox,<\/li>\n<li><img loading=\"lazy\" class=\"size-full wp-image-441\" title=\"yslow\" src=\"http:\/\/blogs.sussex.ac.uk\/elearningteam\/files\/2011\/01\/yslwo.png\" alt=\"\" width=\"32\" height=\"32\" \/> Yahoo&#8217;s\u00a0<a href=\"http:\/\/developer.yahoo.com\/yslow\/\" target=\"_blank\">Yslow<\/a>,<\/li>\n<li> <img loading=\"lazy\" class=\"size-full wp-image-438\" title=\"pagespeed\" src=\"http:\/\/blogs.sussex.ac.uk\/elearningteam\/files\/2011\/01\/pagespeed-64.png\" alt=\"\" width=\"32\" height=\"32\" \/> Google&#8217;s <a href=\"http:\/\/code.google.com\/speed\/page-speed\/\" target=\"_blank\">Page Speed<\/a>,<\/li>\n<\/ul>\n<p>allowed us to analyses what was slowing pages down, and how to improve this.<\/p>\n<h2>1. Minify and compress<\/h2>\n<p>Moodle2 comes with built in minify and gzipping for css and javascript!<\/p>\n<h2>2. Load things in the right place<\/h2>\n<p>Moodle2 theme config.php allows us to load javascript in the footer of the page instead of the header :<br \/>\n<code>$THEME-&gt;javascripts_footer = array();<\/code><\/p>\n<h2>3. Don&#8217;t load things you don&#8217;t need<\/h2>\n<p>Moodle2 allows us to exclude parent theme css and javascript :<\/p>\n<p><code>$THEME-&gt;parents_exclude_javascripts  = array();<br \/>\n$THEME-&gt;parents_exclude_sheets = array();<br \/>\n<\/code><\/p>\n<p>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.<\/p>\n<p>For anyone interested in speeding up their site &#8211; the best\u00a0practice\u00a0guidelines by <a href=\"http:\/\/developer.yahoo.com\/performance\/rules.html\" target=\"_blank\">yahoo<\/a> &amp; <a href=\"http:\/\/code.google.com\/speed\/page-speed\/docs\/rules_intro.html\" target=\"_blank\">google<\/a> (along with the tools above) can be an interesting insight into improving things for your users, and making your code better.<\/p>\n<p>So far, we are just evaluating a test install of moodle2, but will be updating the blog with further findings.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In moodle 1.9 we spent a lot of time optimising the page load speeds and improving the\u00a0quality\u00a0of our code. Using tools including: Firebug for Firefox, Yahoo&#8217;s\u00a0Yslow, Google&#8217;s Page Speed, 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 [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[67,73],"tags":[87,88,74],"_links":{"self":[{"href":"https:\/\/blogs.sussex.ac.uk\/elearningteam\/wp-json\/wp\/v2\/posts\/437"}],"collection":[{"href":"https:\/\/blogs.sussex.ac.uk\/elearningteam\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.sussex.ac.uk\/elearningteam\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.sussex.ac.uk\/elearningteam\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.sussex.ac.uk\/elearningteam\/wp-json\/wp\/v2\/comments?post=437"}],"version-history":[{"count":21,"href":"https:\/\/blogs.sussex.ac.uk\/elearningteam\/wp-json\/wp\/v2\/posts\/437\/revisions"}],"predecessor-version":[{"id":1346,"href":"https:\/\/blogs.sussex.ac.uk\/elearningteam\/wp-json\/wp\/v2\/posts\/437\/revisions\/1346"}],"wp:attachment":[{"href":"https:\/\/blogs.sussex.ac.uk\/elearningteam\/wp-json\/wp\/v2\/media?parent=437"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.sussex.ac.uk\/elearningteam\/wp-json\/wp\/v2\/categories?post=437"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.sussex.ac.uk\/elearningteam\/wp-json\/wp\/v2\/tags?post=437"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}