On Sun, 9 Nov 2008, Olivier Dehon wrote:

>        page1.mas and page2.mas might use comps/grid.mas and/or
>        comps/list.mas.
>        All components have JS required libs. How can the autohandler
>        determine
>        the list of JS libs to add to the head tag of the generated HTML
>        doc ?

I've done this in the past, but I'd recommend not bothering.

Instead, as part of your deployment process, you can simply concatenate 
all your JS into one file, and all your CSS into another.

Make sure your server is configured to serve these files with compression, 
and that it uses proper caching headers.

Most browsers are configured to request no more than 2 files at a time 
from a single server. If you split your JS & CSS over many files, that 
slows down page loading. Even with caching, the browser needs to make a 
requets and get a 304 back.

If you serve just one file, it will be downloaded on their first visit and 
cached afterwards. Just make sure that you do something like change the 
file's path for each deployment.

You can, for example, configure the web server to internally redirect all 
requests for /css/.+/foo.css to /css/foo.css. The bit in the middle can be 
the revision number of the latest release or something like that.


-dave

/*============================================================
http://VegGuide.org               http://blog.urth.org
Your guide to all that's veg      House Absolute(ly Pointless)
============================================================*/

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Mason-users mailing list
Mason-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mason-users

Reply via email to