I want to create a way to update references to css files in jsf in an automated way (through ant, etc.) what is the common practice for this? are there any automated tools available already?
Basically I want to be able to deploy my war file and make sure that any changes the modified css files are downloaded by clients without them having to clear their cache. Thanks for the help!
You can make use of JSF builtin resource library versioning. You’ll only need to introduce a resource library in webapp’s
/resourcesfolder if not done yet. Then you can create a version subfolder with the pattern\d(_\d)*. For example,Which you reference as follows:
The library version is appended as
vparameter in the query string of the generated<link>element.When you need to deploy an update, rename the
1_0subfolder to1_1or something different (can be done by ant) and it’ll be updated and the browser will be forced to download it instead of using the cached one.The same applies to
<h:outputScript>and<h:graphicImage>for JS and image resources.