[Seaside] Script in head tag

Sebastian Sastre ssastre at seaswork.com
Thu Oct 23 11:51:41 UTC 2008

> I can hardly believe that. First the Javascript VM is loading the
> Google Library. Then you call that library to load other libraries.
> This patches the DOM and adds references to these other libraries that
> are then loaded. If you had put these other libraries in the head from
> the beginning, the browser would have started to load them
> immediately. Maybe I am misunderstanding something?
No need to, you can feel it and see. Idea behind that is to favour consumers by
taking advantage of others sites loading same library as yours. So that cache
hit is statistically favoured by the library popularity. When that happen UA
will not make a request at all. The request time is much greater than a cached
load library time so that’s all that really matters.
That said, also there is the value of making easier version load and saving you
from the need to maintain that cacheable content in your server.

> > PD: I've observed in #writeHeadOn: a grouped write 
> (element, scripts and
> > stylesheets) which breaks order of what you ask root to 
> render. I'm reviewing it
> > because strict order is crucial for using this.
> #addScript: and #addStyle: are actually ment for internal use. It is
> currently used by the methods WAComponent>>#styles and
> WAComponent>>#scripts. The order is well thought (see the discussions
> a few years ago in the mailing list).
> Cheers,
> Lukas
I saw the code is made like that to take advantage of one style per component.
But, as recently asked and Phillipe said, that is a convenient hack which is
actually useful but not really intended for production. As I don’t use #style in
my app's components, I find that convenience actually inconvenient.



More information about the seaside mailing list