Moodlel 2.0 :: Invalidate Theme caches?

Moodlel 2.0 :: Invalidate Theme caches?

by Joseph Rézeau -
Number of replies: 4
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

When selecting a theme in Moodle 2.0, there is a "Invalidate Theme caches" button at the top of the list of themes. I am not sure what this is meant to do.

Does it mean:

  1. empty actual theme cache(s) (BTW why the plural ? are there more than one theme caches?)
  2. or disable theme caches on this site from now on?

If (1), then a better wording would be "Empty Theme caches" or "Purge Theme caches". Plus it would be nice if some kind of message were displayed after pressing that button telling the user about what has been done.

Joseph

Average of ratings: -
In reply to Joseph Rézeau

Re: Moodlel 2.0 :: Invalidate Theme caches?

by Sam Hemelryk -
Hi Joseph,

Within Moodle 2.0 themes are now versioned, and cached within your Moodle data directory. The cached information is the combined CSS, the mapped images, and of course any JavaScript the theme has included.

Because theme settings can be used to allow varying themes to be used in different contexts (category, course and user from memory) the cache is designed to the theme based and any number of themes may be cached at any time.

These theme caches are permanent, until they user performs an action they will never be rebuilt (there is no expiry).
In this case the action, clicking the button, deletes the contents of the theme cache directory. You can do this manually by deleting moodledata/cache/theme/*.

As for the wording, perhaps Helen would care to help here, she has a fantastic mind for language strings (she is a fantastic help to me there, I'm terrible when it comes to language). I'll point here towards this when she comes online today.

Cheers
Sam

In reply to Sam Hemelryk

Re: Moodle 2.0 :: Invalidate Theme caches?

by Helen Foster -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Sam, thanks for explaining things and for your kind words. glimlach I would suggest "Clear theme caches" for the button.
In reply to Helen Foster

Re: Moodle 2.0 :: Invalidate Theme caches?

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Thanks to Sam for the clear explanation and to Helen for "Clear theme caches" suggestion.approve

Joseph

In reply to Joseph Rézeau

Re: Moodle 2.0 :: Invalidate Theme caches?

by Helen Foster -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Thanks Joseph, I've just changed the lang string in CVS. (I guessed Sam has lots of tricky bugs to focus on!)