I have a GWT app deployed onto our client’s machines. As an ongoing
development alongside, we have to release new improved versions of the
application fron time to time. Everytime we release a new version we
often run into the problem where the client’s browser has cached the
old scripts scriptsand for a while it behaves strangly as the data it
is trying to work with is not quite compatible with it. What is the
best way to overcome this problem. Currently I have to tell the users
to clear their browser’s cache for a new release but it would be nice
they don’t have to do this.
I have a GWT app deployed onto our client’s machines. As an ongoing development
Share
By default, the bulk of your app should be cached by the browser until a new version of it is generated by your build process.
It might help to understand the GWT bootstrapping model to understand how this works.
The first script your client requests,
your-app-name.nocache.js, is not cached, and it does nothing except check the browser’s user agent and capabilities, and make a second request for the relevant app JS.At this point, the script it requests should be cached by the browser if it’s been requested before. This is a
{indistinguisable-numbers-and-letters}.cache.htmlfile.When you redeploy your app, the
nocache.jsfile will be executed and ask for a differentcache.htmlfile from the server, which will not already be present in the cache, but which will get cached by the browser once it is downloaded.Are you doing anything unusual with deferred binding, or with caching headers on your server? This might potentially be causing your
nocache.jsfile to get cached after all, which would make it request oldcache.htmls from the browser cache.