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

new $CFG->localcachedir

    XMLWordPrintable

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.6
    • 2.6
    • Caching

    Description

      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/*

      Attachments

        Issue Links

          Activity

            People

              skodak Petr Skoda
              skodak Petr Skoda
              Dan Poltawski Dan Poltawski
              David Monllaó David Monllaó
              Matteo Scaramuccia, David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              3 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                18/Nov/13