Clearing Browser cache for upadated deployments

3,215 views
Skip to first unread message

imra...@gmail.com

unread,
Oct 30, 2008, 10:31:53 PM10/30/08
to Google Web Toolkit
Hi,

Basically I would like to know how to support the case where we would
like to deploy an updated application and want changes to be reflected
on the browsers without the user needing to manually clear their
cache. If there isnt a gwt solution, is there an apache or tomcat
solution for handling this?

Thanks,

Imran

walden

unread,
Oct 31, 2008, 8:15:54 AM10/31/08
to Google Web Toolkit
This is how it *should* work, out of the box. Do you have a specific
counterexample?

eggsy84

unread,
Oct 31, 2008, 2:58:05 PM10/31/08
to Google Web Toolkit
Hi imran,

We have experienced the same problems as you describe in which the
user has to shift reload their browser!

As our app is a J2EE app with JSP's we aim to try and solve this with
the JSP no Cache directives?

eggsy

imra...@gmail.com

unread,
Oct 31, 2008, 9:22:55 PM10/31/08
to Google Web Toolkit
I have similar problem to what Eggsy has described, whereby in order
to view the most recent changes it becomes necessary to clear the
browser cache. Unfortunately, apart from a couple of minor JSP pages,
most of our system is built entirely using GWT.

Is there some approach within the GWT code, where you can detect a
version or timestamp which can be used a reference for how upto date a
web app is? I mean I'm looking at perhaps doing this with periodic RPC
calls to the server to check if the web app is upto date and in the
case it is not forcing the browser to refresh (is this even
possible??). I dont like this rather crude approach and would prefer
something which can be left to the app server or apache.

Imran

On Nov 1, 4:58 am, eggsy84 <jimbob...@hotmail.com> wrote:
> Hiimran,

mat

unread,
Nov 1, 2008, 1:47:30 AM11/1/08
to Google Web Toolkit
Hi,

What I usually do is append a random querystring (for each new
version) to the javascript include on the HTML page.

e.g

<script language="javascript" src="http://www.google.com/MyScript.js?
version=20081101"></script>

The browser sees this as a different URL to "http://www.google.com/
MyScript.js".


Mathew

eggsy84

unread,
Nov 2, 2008, 11:35:25 AM11/2/08
to Google Web Toolkit
Hi matthew,

Thats a very good approach I like that. Also it doesn't mean the user
has to change the URL they visit and everything for them will just
work! The developers know the difference.

Good approach!

jhulford

unread,
Nov 3, 2008, 9:33:04 AM11/3/08
to Google Web Toolkit
If that works then it sounds like you don't have caching set up
correctly for the *.nocache.js files. The browser shouldn't be
caching these files at all, to enforce that you'll have to send the
correct response header ("Cache-Control: no-cache, no-store") when
handling the request for those files.

abhijeet

unread,
Dec 20, 2012, 1:55:59 AM12/20/12
to google-we...@googlegroups.com, Google Web Toolkit, mathe...@gmail.com
Is this really i am facing same issues as described below 

1. hosted GWT application in IIS. 
2. browse the application IE.
3. modified the application.
4. Now hosting it again on IIS in same directory with same name n all.
5. IE is showing old version only until I explicitly clears the history nall through IE.

Marco

unread,
Dec 21, 2012, 6:03:30 AM12/21/12
to google-we...@googlegroups.com, Google Web Toolkit, imra...@gmail.com

Thomas Broyer

unread,
Dec 21, 2012, 10:54:43 AM12/21/12
to google-we...@googlegroups.com, Google Web Toolkit, imra...@gmail.com

darkflame

unread,
Dec 29, 2012, 5:46:10 PM12/29/12
to Google Web Toolkit
Remember if using crome with the inspector open, holding down the
reload button gives a option to clear cache/hard reload.
VERY usefull, yet hidden feature.

On Dec 21, 4:54 pm, Thomas Broyer <t.bro...@gmail.com> wrote:
> On Friday, December 21, 2012 12:03:30 PM UTC+1, Marco wrote:
>
> >http://seewah.blogspot.de/2009/02/gwt-tips-2-nocachejs-getting-cached...
>
> See alsohttps://developers.google.com/web-toolkit/doc/latest/DevGuideCompilin...(which
> is also linked fromhttps://developers.google.com/web-toolkit/doc/latest/DevGuideDeploying)
Reply all
Reply to author
Forward
0 new messages