Purge Cache takes Forever with Boost and Child themes

Re: Purge Cache takes Forever with Boost and Child themes

by Urs Hunkler -
Number of replies: 3
Picture of Core developers

I am testing a »hacks« based workflow now with libsass in an external process and the compiling is done nearly instantaneous. With this workflow I can iterate. The »hacks« process seams to work, I don't know if Moodle will compile the same CSS when I remove the »hacks«. That I need to test.

Btw I work with the Mac program »CodeKit«, which is a web design build tool somehow similar to Grunt but with a GUI, which I prefer.

In reply to Urs Hunkler

Re: Purge Cache takes Forever with Boost and Child themes

by David Scotson -
Hi Urs, is there an issue to follow any work on this?

We've recently moved the Snap theme to sub-theme Boost, and this delay is somewhat annoying for developers.

Workarounds we've employed or things we've noticed:

* we have a grunt task that hits this url:  joule2.dev/theme/styles.php/snap/-1/all, this starts the CSS regeneration process as soon as we hit save in our code editors so hopefully it is nearly done by the time we switch to the browser and refresh or load a new page

* we also spotted the tree post process call was taking up a lot of time. We were wanting to skip this in our child theme, but it seems if you set it to null in the child theme, it just uses the value from the parent theme (Boost). Even if you replace the call with a new function that does nothing, it still parses the full tree which is where the time is mostly spent. Hacking the Boost theme

* The time taken seemed to be proportional to the length of the total CSS. Our dev VMs have a whole lot of plugins installed and took an extra 10 seconds compared with a default Moodle install. We also found a few bits of the SCSS code that were using @extend and generating silly amounts of CSS code. We fixed the ones in Snap and also filed a bug upstream about uses of @extend in Boost: MDL-58930

* There are existing PHP extension Sass libraries on github that call the C lib to go faster, though it sounded like they only supported Apache.

Average of ratings: Useful (1)
In reply to David Scotson

Re: Purge Cache takes Forever with Boost and Child themes

by Dan Poltawski -

is there an issue to follow any work on this?

There is a dramatic performance bug with fontawesome in 3.3 which should be fixed this week in MDL-58646

More wide ranging improvements are in epic MDL-59122 subtasks (NOTE: you need to be logged into jira to see epic subtasks for some annoying reason..)

In reply to David Scotson

Re: Purge Cache takes Forever with Boost and Child themes

by Urs Hunkler -
Picture of Core developers

Hi David,

you seam to have found the same topics that slow down the theme development process. I plan to write about my workaround which seams to circumvent the issues quit ok as I can say by now. But I am extremely busy in the moment to get some tasks done so it may last some time until I can write.

And yes, I did hack boost to stop the tree post process there too.