How to force update downloaded content from http?

I m loading a JSON file using

cc.loader.load(this.url+ ‘somejspon.json’ ,function(err, tex){
cc.log('Should load a texture from external url: ’ + (tex instanceof cc.Texture2D));
}

I’ve updated the json file on the server, when I reload the scene on web page. It takes the old file. How to I force the browser to use new file ?

1 Like

this is browser cache! you can see Release a Game on Web platform!


MD5 Cache

Compute MD5 to rename all resources, to resolve the CDN cache problem. After being enabled, if any resource fails to load, it is because the renamed new file can not be found. It is usually because some third party resources was not loaded by cc.loader. If this happens, you can convert the url before loading, to fix the loading problem.
url = cc.loader.md5Pipe.transformURL(url);

Tested but getting error:

 var new_url = cc.loader.md5Pipe.transformURL('http://192.168.1.75:3000/');

LoadConfig.js:17 Uncaught TypeError: Cannot read property ‘transformURL’ of undefined
at LoadConfig.onLoad (LoadConfig.js:17)
at CCClass.eval [as _invoke] (eval at createInvokeImpl (component-scheduler.js:255), :3:65)
at CCClass.invoke (component-scheduler.js:153)
at CCClass.activateNode (node-activator.js:226)
at cc_Scene._activate (CCScene.js:93)
at TheClass.runSceneImmediate (CCDirector.js:614)
at boot.js:378
at CCLoader. (CCAssetLibrary.js:244)
at CCLoader.js:253
at utils.js:85