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

Template cache should be available within the same page

    XMLWordPrintable

Details

    • MOODLE_38_STABLE, MOODLE_39_STABLE
    • MOODLE_38_STABLE
    • MDL-68677-master
    • 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

    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

              dobedobedoh Andrew Lyons
              dobedobedoh Andrew Lyons
              Simey Lameze Simey Lameze
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Mathew May Mathew May
              Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Stevani Andolo, Matteo Scaramuccia, Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Stevani Andolo
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                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