I’ve been using Vaadin for some internal company users, and I’m about ready to deploy for my first larger group of external users. I’ve got Apache fronting Tomcat for this application. Following the advice in the Book of Vaadin, I’ve extracted the /VAADIN/* resources from the vaadin .jar file so that Apache can serve them statically. Along with this, Apache intercepts /VAADIN/* requests and prevents those requests from going to Tomcat.
This would work great assuming I was only using the default (reindeer) theme. Also, when it came time to upgrade my Vaadin version, I would just remove and re-extract the static /VAADIN/* files.
But, things seem to get much more complicated when I’m also using a custom theme, let’s call it “mytheme”. This theme inherits from reindeer. The only way I can think to make this work is to also extract the files from /VAADIN/themes/mytheme to my static Apache file location. This has two serious downsides:
For deployment, I must both deploy my .war file to Tomcat, and extract my custom /VAADIN/themes/mytheme to Apache
To upgrade Vaadin versions, I must both remove and re-extract VAADIN files, and extract my custom mytheme to Apache
Those are some redundant and error prone steps to have to follow for any deployment or Vaadin upgrade. Not so good.
So, I could get fancier with my request routing and have /VAADIN/* requests go to Apache, but have /VAADIN/themes/mytheme/* requests go to Tomcat. This is also a bit complicated, and I’m not even sure it would work. The mytheme styles.css file would say @import url(…/reindeer/styles.css), but I’m not sure that would work as that file would not be available to Tomcat, but only available to Apache.
I would greatly appreciate guidance on the best solution to this question.
I’d add that I’d only move the files to Apache when I knew that it was causing a performance issue - i.e. I’d leave it all sitting in my WAR up and until that causes a problem.