I use the GWT ScriptInjector to inject an external JavaScript file like this:
ScriptInjector.fromUrl("http://example.com/foo.js").setCallback(
new Callback() {
public void onFailure(Exception reason) {
Window.alert("Script load failed.");
}
public void onSuccess(Void result) {
Window.alert("Script load success.");
}
}).inject();
This works fine but not expires header is set, i.e., the browser does not cache this script.
Is it possible to set a header for the ScriptInjector to cache the external js file?