Sfoglia il codice sorgente

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 anni fa
parent
commit
525155fb11
1 ha cambiato i file con 2 aggiunte e 1 eliminazioni
  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 xhr = new XMLHttpRequest(), sceneText;
             var that = this;
             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;
             xhr.onprogress = progressCallback;