Browse Source

XMLHttpRequest is looking first in the cache

Fixing an issue described here : http://www.html5gamedevs.com/topic/6906-problem-with-manifest-cache-new-file-version-not-downloaded/

The last version of a scene cannot be retrieved because of the browser cache.
Temechon 11 years ago
parent
commit
525155fb11
1 changed files with 2 additions and 1 deletions
  1. 2 1
      Babylon/Tools/babylon.database.js

+ 2 - 1
Babylon/Tools/babylon.database.js

@@ -468,7 +468,8 @@ var BABYLON = BABYLON || {};
             var xhr = new XMLHttpRequest(), sceneText;
             var that = this;
 
-            xhr.open("GET", url, true);
+            var urlTimeStamped = url + (url.match(/\?/) == null ? "?" : "&") + (new Date()).getTime();
+            xhr.open("GET", urlTimeStamped, true);
 
             xhr.onprogress = progressCallback;