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

Problem with browser cache and resource loading

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 4.1.9, 4.1.10
    • Resource
    • MOODLE_401_STABLE

      Hello,

      As seen here : https://tracker.moodle.org/browse/MDL-20042 the ticket has been closed but is still in 4.1. Some of our client are impacted in their courses by this behavior.

       

      To resume again the issue :

      The files uploaded in moodle as a relative link to another file, be it in description, content, or as a resource activity, are not charged again until the browser cache is purged when the parent file is modified.

       

      Set this in config $CFG->filelifetime = 0; is a temporary solution, but is absolutely not a good one for a production platform.

      Perhaps something like adding a URL parameters when calling a relative file, the timestamp per example, resolve the issue.

       

      Have a good day,

       


      Here is the step used to reproduce this behavior :

       

      Made on Moodle 4.1.10+ (Build: 20240510) & Firefox

      ------

      I could reproduce this with at least two process, probably more if I really search.
          
          > mod_resource
          

      • Add a mod_resource (name activity01) in which you upload a file test.txt (content : "test01")
      • Add a second mod_resource (activity02) in which the file is a link to the first one, test.txt (Server files > Select "test.txt" > use "Link to the file" option)
      • Save and return to the course. The two activities display the text "test01", as intended.
      • Go edit the first activity (activity01) : Use "add.." to upload a new file, named test.txt too, and use the "Overwrite" option. The content of this file is "test02".
      • Save the edition.

      Here come the behavior:

      • Display the files from activity01 : the content is "test02"
      • Display the files from activity02 : the content is still "test01"

      If you add something to the url, like "?t=123" the content is the good one "test02".
      Cleaning the cache allow to display "test02" too.

      It's independant of the display option.

       

          > Image in text area.

      • In a text area like mod_label, activity/course/other description, etc, use "insert or edit image" to upload an image, named test.png.
      • Save the parameters. The image is displayed as normal.
      • Go in another text area, use "insert or edit image" and with server files select the "test.png" image then "link to the file".
      • Save the modification. The image is the good one.

      Here come the behavior

      • Come into the initial text area where test.png is present. Edit image properties > browse repositories > upload a new different file named test.png > overwrite > save then save the edition page.
      • On the page of the image uploaded from link, it's still the first image being displayed.
      • Only a purge cache or a parameter in the image url update the display to the good new one.

      Note that this process work with "save as" too.

            Unassigned Unassigned
            qc.edunao Quentin
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:

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