First, the user enters the URL of your application, which triggers the browser to
request the application’s HTML file. The HTML downloads a specifically named
When the permutation is loaded, the bootstrap calls the compiled onModuleLoad method from the EntryPoint and the application starts.
The non-cache.js which is mentioned above, contains the cached html file name. if it it there, loaded it, otherwise, request from server:
By naming these files using an MD5 hashing algorithm, GWT ensures two things:
1. The browser can cache the file with no confusion. The next time you run the
application, the startup is even faster.
2. If you recompile, then the bootstrap code will force the browser to load the new version of your application (because it will be asking for a new filename). The
next time you run
It’s as simple as that.
Prevent nocache.js being cached
When a new release comes, we might deploy some new features so the xxx.cache.html content would change. However if the user’s browser still caches the nocache.js, then the new xxx.cache.html would not be able to be downloaded by user.
To prevent this, you can append a UUID to the nocache.js url so that every time the html/jsp is downloaded, it always get the nocache.js downloaded.
<%@ page import="java.util.UUID" %>