I'm running into an issue with my SpringMVC/Thymeleaf application where users experience errors when I release an update that includes changes to static resources (images, CSS files, JavaScript libraries). The problem occurs because they have an old version of the resource in their browser cache, so if they do a force refresh the problem goes away, but most users don't know to do that.
In the past, I've solved this in other frameworks by having my build inject the build number into a Spring bean and customizing the URL building mechanism to include the build number in the URL. Combining this with setting the Cache-Control response header to a far-future date on these resources ensures that as long as the user has the resource in their browser cache, it is never re-fetched unless I release a new build.
Does Spring MVC/Thymeleaf have a built-in way of solving this problem? If not, how do I override the URL writing mechanism in Thymeleaf so that I can add the behavior I described above?