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

Provide more granular purging of caches

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.6
    • 3.4.1, 3.5, 3.6
    • Caching
    • MOODLE_34_STABLE, MOODLE_35_STABLE, MOODLE_36_STABLE
    • MOODLE_36_STABLE
    • MDL-61244_master
    • Hide

      Web interface

      • Visit admin/purgecaches.php
      • Edit theme/boost/scss/moodle/core.scss, add the following at the bottom:
        • body {background-color: pink !important}
      • Edit lang/en/admin.php, and change the string 'purgecachespage' to:
        • 'Purge caches 1'
      • Reload the page
        • The background colour should not change, the title should read "Purge caches"
      • Click "Purge all caches"
        • You should see the message "All caches were purged"
        • The title should say "Purge caches 1"
      • Wait 1 minute and reload the page
        • The background colour should be pink.
      • Change the CSS from "pink" to "red", and the language string from "1" to "2"
      • Tick the "Language strings" check box and click "Purge selected caches"You should see the message
        • "Selected caches were purged"The title should read "Purge caches 2"
      • Wait 1 minute and reload the page
        • The background colour should still be pink.
      • Change the language string from "2" to "3"
      • Tick the "Themes" checkbox and click "Purge selected caches"
      • Wait 1 minute and reload the page
        • The title should still be "Purge caches 2"
        • The background colour should be red
      • Remove the new CSS rule and remove the number from the language string
      • Tick both "Themes" and "Language Strings", and press "Purge selected caches"
        • The title should be "Purge caches"
      • Wait 1 minute and reload the page
        • The background colour should be back to normal
      • Visit admin/purgecaches.php?returnurl=/course/index.php
      • Use either button to purge some caches
        • You should be returned to /course/index.php

      Command-line interface

      • Load a moodle page in the browser.
      • Edit theme/boost/scss/moodle/core.scss, add the following at the bottom:
        • body {background-color: pink !important}
      • Edit lang/en/admin.php, and change the string 'purgecachespage' to:
        • 'Purge caches 1'
      • Reload the page
        • The background colour should not change, the title should read "Purge caches"
      • Run php admin/cli/purge_caches.php
      • Wait 1 minute and reload the page
        • The title should say "Purge caches 1"
        • The background colour should be pink.
      • Change the CSS from "pink" to "red", and the language string from "1" to "2"
      • Run php admin/cli/purge_caches.php --lang
      • Wait 1 minute and reload the page
        • The title should read "Purge caches 2"
        • The background colour should still be pink.
      • Change the language string from "2" to "3"
      • Run php admin/cli/purge_caches.php --theme
      • Wait 1 minute and reload the page
        • The title should still be "Purge caches 2"
        • The background colour should be red
      • Remove the new CSS rule and remove the number from the language string
      • Run php admin/cli/purge_caches.php --lang --theme
      • Wait 1 minute and reload the page
        • The title should be "Purge caches"
        • The background colour should be back to normal
      • Run php admin/cli/purge_caches.php --all --muc
        • You should get an error message about an invalid combination of options.

      "Purge all caches" footer links

      • Go to any page other than the "Purge caches" page
      • Click the "Purge all caches" link in the footer
        • You should return back to the same page
        • You should see the "All caches were purged" message

      Site administration link

      • Click the "Site administration" link
      • Select the "Development" tab
      • The link to purgecaches.php should read "Purge caches", previously it read "Purge all caches"
      Show
      Web interface Visit admin/purgecaches.php Edit theme/boost/scss/moodle/core.scss , add the following at the bottom: body {background-color: pink !important } Edit lang/en/admin.php , and change the string 'purgecachespage' to: 'Purge caches 1' Reload the page The background colour should not change, the title should read "Purge caches" Click "Purge all caches" You should see the message "All caches were purged" The title should say "Purge caches 1" Wait 1 minute and reload the page The background colour should be pink. Change the CSS from "pink" to "red", and the language string from "1" to "2" Tick the "Language strings" check box and click "Purge selected caches"You should see the message "Selected caches were purged"The title should read "Purge caches 2" Wait 1 minute and reload the page The background colour should still be pink. Change the language string from "2" to "3" Tick the "Themes" checkbox and click "Purge selected caches" Wait 1 minute and reload the page The title should still be "Purge caches 2" The background colour should be red Remove the new CSS rule and remove the number from the language string Tick both "Themes" and "Language Strings", and press "Purge selected caches" The title should be "Purge caches" Wait 1 minute and reload the page The background colour should be back to normal Visit admin/purgecaches.php?returnurl=/course/index.php Use either button to purge some caches You should be returned to /course/index.php Command-line interface Load a moodle page in the browser. Edit theme/boost/scss/moodle/core.scss , add the following at the bottom: body {background-color: pink !important } Edit lang/en/admin.php , and change the string 'purgecachespage' to: 'Purge caches 1' Reload the page The background colour should not change, the title should read "Purge caches" Run php admin/cli/purge_caches.php Wait 1 minute and reload the page The title should say "Purge caches 1" The background colour should be pink. Change the CSS from "pink" to "red", and the language string from "1" to "2" Run php admin/cli/purge_caches.php --lang Wait 1 minute and reload the page The title should read "Purge caches 2" The background colour should still be pink. Change the language string from "2" to "3" Run php admin/cli/purge_caches.php --theme Wait 1 minute and reload the page The title should still be "Purge caches 2" The background colour should be red Remove the new CSS rule and remove the number from the language string Run php admin/cli/purge_caches.php --lang --theme Wait 1 minute and reload the page The title should be "Purge caches" The background colour should be back to normal Run php admin/cli/purge_caches.php --all --muc You should get an error message about an invalid combination of options. "Purge all caches" footer links Go to any page other than the "Purge caches" page Click the "Purge all caches" link in the footer You should return back to the same page You should see the "All caches were purged" message Site administration link Click the "Site administration" link Select the "Development" tab The link to purgecaches.php should read "Purge caches", previously it read "Purge all caches"

      Following on from a discussion in Moodle developer chat, it would be nice if it were possible to invalidate parts of Moodle's cache, rather than simply all.

      Currently the MUC allows invalidation of parts of the cache, but other caches such as Theme, Javascript, and language strings are not part of this.

      Theme, Javascript & Language strings can only be purged via the Purge All Caches, which is a bit brutal, especially where MUC caches may not need invalidation.

      Options to:

      1. Purge All
      2. Purge MUC
      3. Purge All Non-MUC Caches (Theme & Javascript & Language)
      4. Purge Theme
      5. Purge Javascript
      6. Purge Language Strings

      on the purge cache page / scripts would allow admins & developers to purge only specific areas.

            marxjohnson Mark Johnson
            mhughes2k Michael Hughes
            Sam Marshall Sam Marshall
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Amaia Anabitarte Amaia Anabitarte
            Votes:
            5 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved:

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