vector
vector

Reputation: 7576

reliable refresh of js resources in Grails - dev env

... is there a reliable way to refresh JavaScript resources in Grails app short of cleaning and restarting it? I've noticed that sometimes it can take a while for some changes to refresh when working ajax calls.

For instance:

$.ajax({
    type    : thisType,
    url     : thisUrl,
    data    : thisData,
    statusCode :  {
        200 : function(){
                console.clear();
                console.log( 'status code 200');
        },
        401 : function(){
                console.clear();
                console.log('log in to continue');
        }

... omitted stuff ...

}); 

I'd get the expected console output when status code was 200, but not when I expected 401. A while later stated getting the expected 401 output and so on with other codes.

Is this indicative of issue with browser cache? I'm using Chrome, Grails 2.0.2,jQuery 1.6 and latest distro of IntelliJ

Upvotes: 0

Views: 688

Answers (1)

txominpelu
txominpelu

Reputation: 1067

In my personal experience, it's most of the time the browser cache. When I use chrome to test my webapps I usually disable the cache by going to settings under Web Tools on the lower right corner and then clicking on Disable cache.

Apart from that my web apps refresh their resources quite quickly and I only find problems when I modify layouts that usually force me to restart the dev server.

Upvotes: 3

Related Questions