Providing static contents from another server

Since the widgetset and theme are quite static, once you have them more or less fixed, I began thinking of getting them to another server, as per both PageSpeed’s and YSlow’s recommendations:

I found the
“Resources” for
that enables you to define custom locations for your resources, i.e. exactly what I want. The problem is, however, the widgetset’s
file is not allowed to remotely access the real website’s document.window property.

Is there a way to make this work without too much elbow grease and hacking?

Well the theme shouldn’t be much of a problem. You just make the css image references point to another url. Also, on the Java side, I guess some implementation of Resource is able to fetch static content from urls. I don’t know, however, would that cause to the resource first be sent to the jvm server and from there on to the client. Hope not.

The widgetset is however a completely different story, can’t help you there.

Alas, it’s not only about the files referenced in the CSS. I want to serve the CSS
from another server. As far as I noticed, the Resources-configuration affects everything under the VAADIN-path, meaning both the themes and the widgetsets.

Take a look at
. I take a bit different approach.

It sounds like you are describing load balancing, for the case that one server’s CPU or IO gets clogged up. While helpful, it doesn’t help my scenario.

My scenario would not help the servers, but the client. Browsers today don’t open many connections to one single domain. I’ve understood that the number of concurrent connections per domain is between 2 and 6
. That means, if one webpage has 100 elements to load from the same domain address, the browser doesn’t open 100 concurrent connections, but only 2-6 at a time.

What I want is to serve static content from a totally new domain, as many high-traffic websites do, to increase the active connections, so that the Vaadin application gets loaded faster to the browser. I get more connections, no unnecessary cookies are sent back and forth, I have more granular control over the compression levels and browser caching for the static resources
I get (some) load balancing for absolutely free.