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

new $CFG->localcachedir

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Fixed
    • Icon: Major Major
    • 2.6
    • 2.6
    • Caching

      The difference from normal $CFG->cachedir is that the directory does not have to be shared by all cluster nodes, the files stored in $CFG->localcachedir MUST NOT change! Default location is "$CFG->dataroot/localcache".

      All files there must use unique revision numbers or hashes because the cached data can not be invalidated by any means - it will support only adding of new files, but no file deletes or overrides. The $CFG->localcachedir will be growing over time, all local cache files will be deleted during purge_all_caches() (usually upgrade).

      When using hashes please make sure the number of files in one directory is kept to some reasonable number because some filesystems might have problems with large number of files in one directory.

      Design requirements:

      • Everything must be automatic without extra administrative overhead.
      • purge_all_caches() on any node triggers local cache purging on all other nodes before adding any new files there.
      • Performance on standalone servers must not be worse.

      Usage restrictions:

      • No file deletes
      • No file modifications
      • No file overwriting
      • Soft limit on maximum number of files in one directory (few thousands)

      Benefits:

      • clustered servers may use local tempfs
      • no opcache cache invalidation problems if php files included from localcachedir (because the files must not change)

      Converted areas:

      1. lib/javascript.php
      2. theme/*

            skodak Petr Skoda
            skodak Petr Skoda
            Dan Poltawski Dan Poltawski
            David Monllaó David Monllaó
            Votes:
            3 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.