Pages loads very slowly

Pages loads very slowly

by Станислав Сивинский -
Number of replies: 8

Hello, my Friends!

I'm coding my own Moodle's theme. I turned on the "themedesignermode", which help to clear cache in browser. But, now pages are loaded very slowly (8 - 15 seconds);

How can I speed up pages reloading?

P.S. Can I use webpack with Moodle? I want to program my theme with using Webpack (autoprefixer, hot-reload and other tasty things).

Moodle (3.4 version) and use SCSS.

Thank you.

Average of ratings: -
In reply to Станислав Сивинский

Re: Pages loads very slowly

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Turn off theme designer mode!!  They will always load slowly with that on.  While it is a nice feature for design purposes, it drags the site to a crawl.  I don't use it as I find a quick page reload will normally pull any new css anyway and I would rather just hit the clear caches once in a while instead.

Average of ratings: Useful (1)
In reply to Emma Richardson

Re: Pages loads very slowly

by Станислав Сивинский -
I turned off theme designer mode and added event to clear cache on cron (1 minute between clear-action). But pages loads slowly. If i turn off theme designer mode and action to clear cache, speed is normal.
In reply to Станислав Сивинский

Re: Pages loads very slowly

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers
It's the cache rebuild that takes the time (Or at least the re-rendering without an existing cache), so using cron to clear the cache every minute is probably not a good plan.

Since the move to SCSS (and to some extent, although not quite as pronounced, with the LESS on-demand processing) fresh page loads have been very slow.

The best 'trick' is the one Emma recommended, simply leave designer mode off and then purge all caches only when you make a development change that may impact the cache (anything building css/js for example)

In reply to Станислав Сивинский

Re: Pages loads very slowly

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Hi, 

I advise people not to use Theme Designer Mode for that very reason. It is exceedingly slow and frustrating as it does make development so time consuming.

I have not used it for years now, I gave up a long time ago. It is actually quicker to just do a Purge all cache, which works quicker In comparison.

I have no idea about Webpack! but given that Moodle Themes can be very simple, and yet others can be very complex...so this would be up to you. I dare say you could creat a nice looking website structure using software like that, but at the end of the day you would need to add the code that makes it into a Moodle theme which can be tricky if you are new to this way of working?

Hope this helped?

Mary

 

Average of ratings: Useful (1)
In reply to Mary Evans

Re: Pages loads very slowly

by Станислав Сивинский -

But I want hot-reloading and quickly apply new changes. I'm using $theme->scss for include scss-files

In reply to Станислав Сивинский

Re: Pages loads very slowly

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Well if you like that kind of thing use it...makes no difference to me as I don't have a clue to what you are talking about!

All I know is, that theme development can be nerve wrecking and time wasting, so any I would think that any tools available to help with creating a Moodle theme would be a bonus. 

Someone did create a Moodle Theme ENGINE for MOODLE 1.7 that worked very well up until we migrated to Moodle 2.0

Ouch!

In reply to Mary Evans

Re: Pages loads very slowly

by Станислав Сивинский -

Thank you, Mary. I use the browser tools, for example, the Elements tab in the Chrome browser. I'm writing a CSS style, and then I copy the text into a SCSS file.

May be I'll save all the html pages from Moodle. And I will write the design of the theme separately, as an independent site.

In reply to Mary Evans

Re: Pages loads very slowly

by Станислав Сивинский -

Of course, I can separately write the layout of the pages and then insert the Moodle code into the templates. But I want to write the code of the theme immediately. Sorry for my English. A little practice.