浏览代码

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 年之前
父节点
当前提交
525155fb11
共有 1 个文件被更改,包括 2 次插入1 次删除
  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;