When we deploy a new build of our SmartGWT application the user's browser doesn't always run the latest version of the code. The user has to clear their browser cache to get the updated app. Is there a way to force the browser to recognize the new version?
Announcement
Collapse
No announcement yet.
X
-
Advice for handling this for any other website also applies to SmartGWT. You can place the resources at a distinct URL, for example, to ensure caching is defeated. Or, right before the new release, you can decrease the amount of time that the Expires headers allow resources to be cached.Last edited by Isomorphic; 10 Apr 2012, 14:58.
-
Thanks. I did a little more research and found out more about GWT's "perfect caching" strategy. But for that to work you still need to implement something on the server to prevent caching of the myApp.nocache.js file. This blog post describes how to create a filter in Tomcat (the app server we're using) to properly handle the *.nocache.js file produced by the GWT compiler.
Comment
-
Yes, that solves part of the problem, it's actually a bit of a fancy name for the ability to cache .js files as application logic, which has been around a long time. However when you consider cached media files and other related files, GWT's "perfect caching" is actually just handling a portion of the problem.
Comment
-
Originally posted by jay.l.fisher View PostWhen we deploy a new build of our SmartGWT application the user's browser doesn't always run the latest version of the code. The user has to clear their browser cache to get the updated app. Is there a way to force the browser to recognize the new version?
I developed my own version checking logic.
When I build my app, I put the version number I entered during build process combined with timestamp into my properties file, both on client and server. When server starts, it reads that token so it knows its actual version. After deployment of the new version, I deliberately invalid all session so all clients have to relogin. After login, a client app sends its version to the server and the server responds with specific token if they differ. Then a client app presents a dialog with message "Press Ctrl+F5" to refresh version. Not perfect, but works for me.
Comment
-
Originally posted by jay.l.fisher View PostWhen we deploy a new build of our SmartGWT application the user's browser doesn't always run the latest version of the code. The user has to clear their browser cache to get the updated app. Is there a way to force the browser to recognize the new version?
Comment
Comment