Mathieu Anthoine Posted March 10, 2016 Share Posted March 10, 2016 When I use a json (hash) to load a texture made for example in Texture Packer, I can manage the cache for the json file in adding some parameters after the json file url : myLoader.add("myTexture.json?0.1.0"); But How can I control the extra png files (described in the json file) to be loaded again without using the browser cache ? Thank you Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted March 10, 2016 Share Posted March 10, 2016 Dont. use. dots. in. query. Quote Link to comment Share on other sites More sharing options...
itsLondi Posted August 6, 2021 Share Posted August 6, 2021 What worked for me is adding a middleware function that appends the cache-busting bit (hash, version number, timestamp) to the URL of each resource loaded: app.loader.pre((resource, next) => { resource.url += `?t=${Date.now()}`; next(); }); app.loader.add('./textures/road-textures.json'); app.loader.load((loader, resources) => { // ... } ivan.popelyshev 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.