Export to GitHub

struts2-jquery - issue #506

Reflecting changes without clearing browser cache


Posted on Apr 26, 2011 by Helpful Giraffe

Hi Johannes,

Whenever me make changes in js, css, jsp and deploy on App Server... One usually has to clear cache on all browsers to see the new changes. Same is the case when a jquery-plugin jar or grid-plugin jar is migrated from lower version to higher version.

My application is deployed on Websphere server and used by more than 40k+ users across the globe. We cannot possibly ask the end users to delete cache from their browsers whenever a new release of the application is deployed. In IE, it is even more painful as you need to physically delete the files.

  1. Is there any solution (by any means necessary) to this problem ?

  2. Is this only the case with jquery or with other js libraries like prototype, yui, mootools / dojo also.

Regards, Darshan Shroff shroffdarshan@gmail.com http://www.linkedin.com/in/darshanshroff

Comment #1

Posted on Apr 26, 2011 by Swift Lion

I think there are 2 solutions.

1.) Add a time stamp parameter after every resource

myscript.js?time=20110426093600

this forces a reload. But with this way you disable caching.

2.) rename your scripts myscript-0.x.js instead of myscript.js

This problem is independent from your javascript lib.

Comment #2

Posted on Apr 26, 2011 by Helpful Giraffe

Point number 2 sounds good for the application specific js, css files. Thanks.

However the library issue would still remain. i.e. whenever a jquery plugin jar or jquery grid jar is migrated, it should not cause javascript errors due to cache not cleared. Please fix the same for future versions.

Comment #3

Posted on Apr 26, 2011 by Swift Lion

I apply this for the most common resources.

http://code.google.com/p/struts2-jquery/source/detail?r=1387

Comment #4

Posted on Apr 28, 2011 by Helpful Giraffe

Thank you.. this was very helpful... we resolved all our cache issues yesterday because of this.. Thank you...

Darshan Shroff shroffdarshan@gmail.com http://www.linkedin.com/in/darshanshroff

Comment #5

Posted on May 5, 2011 by Swift Lion

(No comment was entered for this change.)

Comment #6

Posted on May 6, 2011 by Swift Lion

(No comment was entered for this change.)

Comment #7

Posted on May 31, 2012 by Grumpy Dog

can u please tell us how to fix the issue using that files..

Status: Fixed

Labels:
Type-Enhancement Priority-Low Component-Plugin Milestone-3.0.0