Improving cache loading

Improving cache loading

by T K -
Number of replies: 1

Moodle 3.4

We were looking at the cache settings at server level, I found these 3 options, however none is setup at my config.php.

//     $CFG->tempdir = '/var/www/moodle/temp';        // Files used during one HTTP request only.

//     $CFG->cachedir = '/var/www/moodle/cache';      // Directory MUST BE SHARED by all cluster nodes, locking required.

//     $CFG->localcachedir = '/var/local/cache';      // Intended for local node caching.


What is the default cache settings?

We are facing a delay in loading courses in the dashboard view. Does anyone know which codes to look into this possible time lag in loading the dashboard contents?

Thanks In advance.



Average of ratings: -
In reply to T K

Re: Improving cache loading

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

Presumably this relates to this other post.

The defaults for these settings are:

  • $CFG->tempdir = "$CFG->dataroot/temp"
  • $CFG->cachedir = "$CFG->dataroot/cache"
  • $CFG->localcachedir = "$CFG->dataroot/localcache"

Where $CFG->dataroot is the Moodledata directory. You would normally only change these settings if the site used multiple web servers, or "nodes", as the comments in config-dist.php say:

// It is possible to specify different cache and temp directories, use local fast filesystem
// for normal web servers. Server clusters MUST use shared filesystem for cachedir!
// Localcachedir is intended for server clusters, it does not have to be shared by cluster nodes.