On 11.4.2011 23:47, George Sexton 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.
For all static resources (css, images, js) you might add artificial
parameter that will trigger reload, like this:
href="some.css?v=${parameter}"
Where 'parameter' might be:
1. Static resource last modification time. This will trigger reload
every time resource is changed.
2. Static resource hash, this will trigger reload every time static
resource is changed (except for the insignificant number of cases)
3. Application version (1.3.1, 1.3.2...). This will trigger reload every
time new version of application is released. This requires proper
release process, and triggers some extra reloads even when there is no
need for that.
4. Current system time. This will trigger reload of resource every time.
We use no. 3, since Maven packaging makes it really easy to implement
(${pom.version}}.
Regards,
Ognjen
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org