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

new $CFG->localcachedir

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.6
    • Fix Version/s: 2.6
    • Component/s: Caching
    • Labels:

      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

              Assignee:
              skodak Petr Skoda
              Reporter:
              skodak Petr Skoda
              Integrator:
              Dan Poltawski
              Tester:
              David Monllaó
              Participants:
              Component watchers:
              Matteo Scaramuccia, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
              Votes:
              3 Vote for this issue
              Watchers:
              10 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                18/Nov/13