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

Cache the siteid and site contextid in local cache

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Development in progress
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: Future Dev
    • Fix Version/s: None
    • Component/s: Performance
    • Testing Instructions:
      Hide

      Performance test

      Before applying the patch

      1. Turn on performance debugging in config.php:

        $CFG->perfdebug = 15;
        

      2. Load any page, reload it a couple times to get everything warm and look at DB reads in the footer (eg I see 56)

      After applying the patch

      1. Apply the patch
      2. Reload the same page several times
        1. Confirm that the DB reads went down by 1 (e.g. I see 55 instead of 56)

      Upgrade test

      1. Open the version.php file in your editor
      2. Find the $version variable and increment it by one at the end
      3. Run an upgrade in the UI (visit /admin)
        1. Confirm that there were no errors
      4. Increment the version number in $version again
      5. Perform a CLI upgrade:

        php admin/cli/upgrade.php
        

        1. Confirm that there were no errors

      Installation test

      1. Ensure that the code is up-to-date and clean:

        git checkout .
        git reset --hard origin/[branch]
        git clean -df
        

      2. Uninstall your current site and remove the config.php
      3. Perform a fresh install via the UI
        1. Confirm that there were no errors
      4. Drop the database again but retain the config.php
      5. Perform a fresh install via the UI
        1. Confirm that there were no errors
      6. Uninstall your current site and remove the config.php
      7. Perform a fresh install via the CLI using php admin/cli/install.php
        1. Confirm that there were no errors
      8. Drop the database again but retain the config.php
      9. Perform a fresh install via the CLI using php admin/cli/install_database.php
        1. Confirm that there were no errors
      Show
      Performance test Before applying the patch Turn on performance debugging in config.php: $CFG->perfdebug = 15; Load any page, reload it a couple times to get everything warm and look at DB reads in the footer (eg I see 56) After applying the patch Apply the patch Reload the same page several times Confirm that the DB reads went down by 1 (e.g. I see 55 instead of 56) Upgrade test Open the version.php file in your editor Find the $version variable and increment it by one at the end Run an upgrade in the UI (visit /admin) Confirm that there were no errors Increment the version number in $version again Perform a CLI upgrade: php admin/cli/upgrade.php Confirm that there were no errors Installation test Ensure that the code is up-to-date and clean: git checkout . git reset --hard origin/[branch] git clean -df Uninstall your current site and remove the config.php Perform a fresh install via the UI Confirm that there were no errors Drop the database again but retain the config.php Perform a fresh install via the UI Confirm that there were no errors Uninstall your current site and remove the config.php Perform a fresh install via the CLI using php admin/cli/install.php Confirm that there were no errors Drop the database again but retain the config.php Perform a fresh install via the CLI using php admin/cli/install_database.php Confirm that there were no errors
    • Pull 3.11 Branch:
      MDL-71014-cache-siteid-MOODLE_311_STABLE
    • Pull Master Branch:
      MDL-71014-cache-siteid

      Description

      As MDL-47456 was reverted this is a second attempt to avoid this call but using a different approach which should be much safer: just caching the siteid in localcache

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              brendanheywood Brendan Heywood
              Reporter:
              brendanheywood Brendan Heywood
              Participants:
              Component watchers:
              Matteo Scaramuccia, Andrew Nicols, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated: