tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Francis GALIEGUE <...@one2team.com>
Subject Re: OT: Versioning in Javascript Files
Date Tue, 12 Apr 2011 08:04:10 GMT
On Mon, Apr 11, 2011 at 23:47, George Sexton <georges@mhsoftware.com> wrote:
> I'm looking for ideas on how other people are doing versioning in Javascript
> files. I'm hitting issues if I change my files in an incompatible way, or I
> upgrade files.
>
> For example, if I upgrade from DOJO 1.5 to DOJO 1.6, the user's browsers are
> not always refreshing the DOJO files, and things don't work.
>
> Similarly, if I update a javascript function to take additional arguments,
> then the browser using the old version throws an error.
>
> I've spent a lot of time in the past few days telling users to click on the
> refresh button of their browser and I'm pretty sick of it.
>
> I've thought of versioning my whole "scripts" directory. IOW, if my app
> version is 3.4.9, make the scripts directory scripts-3.4.9 to force the
> browser to get files from the new location. This is kind of a pain for
> version control reasons but otherwise it's OK.
>
> I'm really looking for ideas on how other web developers are handling this
> problem.
>

Simple solution: change paths if you change versions!

1.5 would be /static/dojo-1.5.js, 1.6 would be /static/dojo-1.6.js, etc.

I don't know your setup exactly, but it is highly probable that the
server sends back cache control headers saying that this file at this
URL expires some time in the future. If the URL doesn't change, the
browser won't even bother reloading. It is only if the path changes
that you can be sure that the new version will be reloaded.

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
fge@one2team.com
40 avenue Raymond Poincaré
75116 Paris

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message