Spring boot vaadin static content

416 views Asked by At

I'm using spring boot with vaadin. How should I serve VAADIN folder? I deploy to production using gradle distZip task, which creates a lib and a bin folder. I don't want to include VAADIN folder into the jar because it disables caching and makes a fat jar.

Where should I place the folder, what modifications must be done to serve it from a directory, and not the jar itself?

1

There are 1 answers

0
Tobi On

I don't know if this fits your needs but your resources can be outsourced to a CDN provider or to your own server or servlet that is better optimized to serve static content.

@WebServlet( value = "/*",  initParams = @WebInitParam( name = "Resources", 
                 value = "http://your-cdn.provider.com/cdn-example" ) )

See this article for further details.