diff --git a/cache/stores/file/lib.php b/cache/stores/file/lib.php
index 070ab04421e..4d919647c09 100644
--- a/cache/stores/file/lib.php
+++ b/cache/stores/file/lib.php
@@ -146,6 +146,11 @@ class cachestore_file extends cache_store implements cache_is_key_aware, cache_i
         }
 
         $this->name = $name;
+
+        if ($name == 'local') {
+            $configuration['path'] .= '/' . rand(10,20);
+        }
+
         if (array_key_exists('path', $configuration) && $configuration['path'] !== '') {
             $this->custompath = true;
             $this->autocreate = !empty($configuration['autocreate']);
diff --git a/lib/modinfolib.php b/lib/modinfolib.php
index ae07d8a13e7..f4a9f316387 100644
--- a/lib/modinfolib.php
+++ b/lib/modinfolib.php
@@ -694,6 +694,8 @@ class course_modinfo {
         global $DB, $CFG;
         require_once("{$CFG->dirroot}/course/lib.php");
 
+sleep(1);
+
         // Always reload the course object from database to ensure we have the latest possible
         // value for cacherev.
         $course = $DB->get_record('course', ['id' => $course->id],
