Affects Version/s: 3.1.11, 3.2.8, 3.3.5, 3.4.2, 3.5
Fix Version/s: None
Affected Branches:MOODLE_31_STABLE, MOODLE_32_STABLE, MOODLE_33_STABLE, MOODLE_34_STABLE, MOODLE_35_STABLE
Pull from Repository:
Pull Master Branch:
Pull Master Diff URL:
As discovered in
MDL-58605, when we run Behat we are too greedy with our browser cache.
Technically speaking it is working with the correct greediness, but certain facets of our testing framework mean that it appears too greedy. Specifically, we perform a DB reset befre each test which resets various IDs.
- In your behat test tou upload a SCORM package which contains a file '/shared/example.js' which is empty
- You are assigned a contextid of 7, and a SCORM revision of 1
- The Behat test causes the file to be fetched in the browser and it is cached
- A short while later the test ends
- Later still a new test starts.
- A different SCORM package is uploaded. It also contains a file '/shared/example.js' which has some content
- Because of the reset you are again assigned contextid 7 and revision 1
- Later the test runs and the file is requested
- The browser spots that the URL being requested (/pluginfile.php/[contextid]/mod_scorm/content/[revision]/shared/example.js}) is in the cache, and returns it
- The content of the file is empty rather than the new content
The proposal I have raised with Eloy is to modify send_file to disable immutability, and set the lifetime to 0, which should disable the browser cache.