GBear Posted March 6, 2016 Share Posted March 6, 2016 hi.. i'm developing 2dmmorpg with html5.+ webgl how can i reload js or index.html when code changed? mobile is always using caching. so i can't reload. couple a minute i can.... do you have tips for this? Quote Link to comment Share on other sites More sharing options...
mattstyles Posted March 6, 2016 Share Posted March 6, 2016 You could be talking about 2 different things. If you want the page to refresh automatically when you save files then use LiveReload. Chrome has an extension for it, otherwise inject a client script and start a livereload server. The livereload server simply emits events when things change (by default it'll watch the file system), the client hears it and reloads the page (or reloads css if it detects that change). There are usually a fair number of parameters. If you are talking about general cache invalidation, then, there are only two hard things in computer science, although in this case it shouldnt be too hard Putting things into debug or development mode usually invalidate any caches on the client. If that doesnt work then set Cache-Control headers (there are Expiry headers you can play with too for some use-cases) on your server. 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.