Skip to main content

Precaching Moodle Theme CSS

I've run into a few issues recently with my Moodle site ( due to the amount of time it takes for Moodle to compile the CSS cache for the new default theme, Boost.

For most this is may be a one off issue that will go away once the CSS is compiled for the first time. This however really affects me as my site runs on a Raspberry Pi and so is lacking the raw grunt most servers will have to take this initial hit. On it takes over 10 mins to run this CSS compilation and as such does not finish within my PHP max_execution time. I could just raise my timeouts above this, but this still would mean my first visitor will probably never see a page load.

While this may actually be a bug it's still very much a general problem for me running on such minimal resources. My solution is to run a CLI script to precache the Moodle CSS after an upgrade and before I leave maintenance mode. Now any downtime is graceful and CSS compilation and caching occurs without being affected by LAMP stack timeouts. My script is basic, but hopefully does the job (no guarantees!).

Also see related forum posting here:


  1. No deposit bonus codes for 2021 - DrmCMD
    You need to enter the code MAXONUS for Enter MAXONUS 부산광역 출장샵 to 제주도 출장안마 get the no deposit 아산 출장샵 bonus you want, 광양 출장마사지 when prompted. · Your 안성 출장샵 winnings


Post a Comment

Popular posts from this blog

Moodle on Centos or Red Hat 7 (with SELinux!)

Why the need for another 'Installing Moodle' guide? Two reasons, Systemd and SELinux. The steps are presented as a Bash script, which may be run on a virgin system, installing a complete working Moodle stack in one go, including enforcing SELinux. In addition to the absolute basics it also includes adding ClamAV virus for file uploads and Memcached for sessions and 'MUC'. It does not cover any extras you will need to get your site up to production, e.g. securing your database  or updating your virus definitions automatically. Neither does it do any extra PHP configuration (upload limits, execution time etc.) or any extra complexities that might be desirable. For all of this you should goto .

Spawning many VirtualBox machines from a single VDI

What I'm taking about here is a way to have many VirtualBox machines based upon a single hard drive image. There are many reasons why you might like to do this, but the most compelling is probably saving time by not having to install an OS over and over again, especially useful if you do anything like software testing. Our goal is a single vdi (virtual disk) file which contains a vanilla installation of our favourite OS which we can then use to conjure up a fresh new machine in a jiffy. Assuming you already have VirtualBox installed our first step is (maybe for the last time ever!) to install our OS into a new virtual machine. Now I shan't go through this as it's pretty straight forward and if you're reading this it's the sort of thing you have probably done a hundred times before. One thing of note during the initial setup is the 'Virtual Hard Disk' configuration. Be sure to allocate enough space to allow for all potential applications of the image. It wou

Blocking Adverts from the Roku Menu

UPDATE: 18 May 2013 - A new firmware (v5) has changed the way ads are handled on the Roku such that this guide is no longer relevant.  Roku are are a pretty neat little media streaming box but one thing that I think lets them down are the trashy and mostly irrelevant adverts on the home page. Wouldn't it be great if you could get rid of these? The ads are served by the third party ad platform,  ZEDO . You can block the ads from displaying by simply blocking this domain entirely or by being more targeted and blocking the specific sub-domain serving the Roku ads. A TCPDUMP of my Roku shows that the ad images currently come from '' (although this may change). I block them by adding a custom DNS record for this sub-domain to my home router pointing to the loopback address ( There are or course many other ways you could do this, but the best way will largely depend on your own set-up and resources.