Moodle
  1. Moodle
  2. MDL-32825

make file operations more atomic in theme image, css and other javascript serving scripts

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.3
    • Fix Version/s: 2.3
    • Component/s: General
    • Labels:
    • Rank:
      39852

      Description

      The problem is similar to lang caching, sometimes the files may be read before we complete the actual writing of cache files, this might result in broken/incomplete data landing in proxy or browser caches:

      • /lib/javascript.php
      • /theme/image.php
      • /theme/styles.php
      • /theme/javascript.php

      The more we cache the worse this can get...

        Issue Links

          Activity

          Hide
          Petr Škoda added a comment - - edited

          The patch should resolve all potential theme and JS file caching problems. It relies on the fact that:
          1/ copy() does not override existing files
          2/ fopen() 'xb' flag only creates file if does not exist
          3/ if we for any reason can not create the cache file we try to send uncached information instead
          4/ cache operations are not interrupted by user abort any more

          Show
          Petr Škoda added a comment - - edited The patch should resolve all potential theme and JS file caching problems. It relies on the fact that: 1/ copy() does not override existing files 2/ fopen() 'xb' flag only creates file if does not exist 3/ if we for any reason can not create the cache file we try to send uncached information instead 4/ cache operations are not interrupted by user abort any more
          Hide
          Dan Poltawski added a comment -

          Integrated, thanks

          Show
          Dan Poltawski added a comment - Integrated, thanks
          Hide
          Petr Škoda added a comment -

          yay, thanks a lot!!

          Show
          Petr Škoda added a comment - yay, thanks a lot!!
          Hide
          Ankit Agarwal added a comment -

          No issues, all seems to be working fine.
          Passing
          Thanks!

          Show
          Ankit Agarwal added a comment - No issues, all seems to be working fine. Passing Thanks!
          Hide
          Eloy Lafuente (stronk7) added a comment -

          This is now part of Moodle and a few millions people around the globe will be using it soon. Isn't that awesome?

          Many, many thanks and don't forget http://youtu.be/4N7dPaP5Z8U

          Closing, ciao

          Show
          Eloy Lafuente (stronk7) added a comment - This is now part of Moodle and a few millions people around the globe will be using it soon. Isn't that awesome? Many, many thanks and don't forget http://youtu.be/4N7dPaP5Z8U Closing, ciao

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: