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

Template cache should be available within the same page

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. Open Moodle
      2. Ensure that the $CFG->cachejs is disabled (i.e. mdk run dev)
      3. Open the browser tools to the "Network" tab
      4. Open Moodle to any page
      5. Wait for the page to finish loading
      6. Bring up both the "Network" and "Console" tabs (Press Escape to slide the Console up usually)
      7. Clear both space
      8. Run the following code:

        require(['core/loadingicon'], L => L.addIconToContainer(document.querySelector('div')));
        

        1. Confirm that at the very top of the page you see a Loading spinner
      9. Clear the "Network" tab again
      10. Run the same code again
        1. Confirm that you see a second spinner
        2. Confirm that there are no new network requests

      Note: On master if MDL-68528 has already been applied you will likely not see any requests on the first call either. Until that issue is integrated you will likely see:

      • before first run: Some initial calls to prefetch some templates;
      • with first run: one call to core_get_string
      • with second run: no new calls
      Show
      Open Moodle Ensure that the $CFG->cachejs is disabled (i.e. mdk run dev ) Open the browser tools to the "Network" tab Open Moodle to any page Wait for the page to finish loading Bring up both the "Network" and "Console" tabs (Press Escape to slide the Console up usually) Clear both space Run the following code: require(['core/loadingicon'], L => L.addIconToContainer(document.querySelector('div'))); Confirm that at the very top of the page you see a Loading spinner Clear the "Network" tab again Run the same code again Confirm that you see a second spinner Confirm that there are no new network requests Note: On master if MDL-68528 has already been applied you will likely not see any requests on the first call either. Until that issue is integrated you will likely see: before first run: Some initial calls to prefetch some templates; with first run: one call to core_get_string with second run: no new calls
    • Affected Branches:
      MOODLE_38_STABLE, MOODLE_39_STABLE
    • Fixed Branches:
      MOODLE_38_STABLE
    • Pull 3.8 Branch:
    • Pull Master Branch:
      MDL-68677-master

      Description

      MDL-66367 introduced a M.cfg.templaterev to separate out the cachejs and cachetemplates better.

      Right now that value works inconsistently and will allow some things to be cached, and others not.

      We have a weird distinction between templatePromises and cachePartialPromises and the templaterev is allowing templatePromises to be cache don page, but not cachePartialPromises.

      This variable was intended to only prevent use of the browser Local Storage API for persistent caching. Right now it prevents even use of some in-page caching.

      We need to adjust the core/templates and make the templaterev check a few lines later so that it allows in-page caching.

      This makes developer experience much more pleasing.

        Attachments

        1. 38 #10.png
          38 #10.png
          523 kB
        2. 38 #8.png
          38 #8.png
          591 kB
        3. Master #10.png
          Master #10.png
          496 kB
        4. Master #8.png
          Master #8.png
          491 kB

          Issue Links

            Activity

              People

              Assignee:
              dobedobedoh Andrew Nicols
              Reporter:
              dobedobedoh Andrew Nicols
              Peer reviewer:
              Simey Lameze
              Integrator:
              Eloy Lafuente (stronk7)
              Tester:
              Mathew May
              Participants:
              Component watchers:
              Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Matteo Scaramuccia, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                13/Jul/20

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 hours, 59 minutes
                  2h 59m