Javascript caching on Android/Glass/WearScript
I was doing some local WearScript development, and was pulling my hair out because I couldn't get the application to load changes I'd make to javascript files used by the page. Of course any changes I made to the scripts embedded in the html would be changed, but the script includes just wouldn't change. For a little while in order to make progress I just renamed the script every revision. That's obviously a horrible thing to do, so I eventually found a better solution.
webview.clearCache(true)
This clears the resource cache of all WebViews associated with the current application.
Now when I use adb to push new versions of javascript files, they get reloaded immediately! The disadvantages of this should be pretty obvious: if there's something big that's not changing, there's no point in reloading it every time. But when the hell am I going to be loading something big in WearScript? The resource cache is dwarfed by the bandwidth used for photos and videos in other applications, so I figure the advantages pretty much outweigh the disadvantages. This may affect offline access, but that deserves its own separate treatment anyway
http://developer.android.com/reference/android/webkit/WebView.html
www.wearscript.com










