Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-66459

Running large CSS files through prefixer in Boost are really slow

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.6.3
    • Fix Version/s: None
    • Component/s: Themes
    • Affected Branches:
      MOODLE_36_STABLE

      Description

      We have a lot of customers having their own themes and they all extend from the Boost theme. The problem is that the Boost theme runs a function in lib.php called theme_boost_css_tree_post_processor() which runs through all lines of code and adds prefixes to css rules, each time the cache is purged. This takes a really long time (up to 2 minutes) and it is painful to develop themes with that kind of speed.

      In the theme/boost/config.php file:
      $THEME->csstreepostprocessor = 'theme_boost_css_tree_post_processor';

      If we comment this line out it takes about 20-30 seconds and that is still very slow, but better. A solution to this problem could be to minify and run prefixer locally, like it should be and upload that file along with the Moodle version. Then Moodle just loads the file and that's it.

      Note: we do minify and run prefixer on our own themes locally and just uploads the CSS.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              mcardle Ulrik McArdle
              Participants:
              Component watchers:
              Bas Brands, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: