Skip to main content

Posts

Showing posts from May, 2017

Precaching Moodle Theme CSS

I've run into a few issues recently with my Moodle site ( moopi.uk ) 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 moopi.uk 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 affe