Gilles, i'm very interested in your approach. I usually organize my js and css external files inside the php process in a much similar manner, adding jquery plugins necessary to output the user selected interface. Integrating your load.php file would be cherry on the cake. Would you mind publishing it somewhere?
Thanks alexandre -----Original Message----- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Gilles (Webunity) Sent: lundi 16 juillet 2007 11:31 To: jQuery (English) Subject: [jQuery] Re: dev tip: combining JS script files The filemtime is checked, if there are no differences, the precompiled files (CSS/JS) are served. Load times are still around 1sec ;) On Jul 16, 11:23 am, Klaus Hartl <[EMAIL PROTECTED]> wrote: > Gilles (Webunity) wrote: > > I've build something similar to this; here's how i did it: > > on my webserver, there are a bunch of JS and CSS files. During each > > page load, i create an array of CSS and JS files, which have to be > > included on that page. Currently i store these in session, but that > > isn't needed. In the header of the page, i have 2 calls, one to "/ > > framework/load?css/<scriptname>" and one to "/framework/load?js/</ > > scriptname>". That script ("load" is a PHP file which reads the > > scriptname>array, > > generates a hash out of it, checks to see if the files are modified > > since the last time they where "build" and if so, recombines all > > files and minifies them (in case of JS: Packer, in case of CSS: > > remove newlines, comments and tabs). After compiling it writes the > > generated file to disk and serves that to the browser. It was a lot > > of work, but it allows me to keep all original JS and CSS files on > > the server (= greater maintainability) and improves load times drastically. > > > HTH > > > -- Gilles > > You're saying that is done on each page load. Isn't it better to do > that once, when deploying the files? How long does it take to merge the files? > > --Klaus Ce message Envoi est certifié sans virus connu. Analyse effectuée par AVG. Version: 7.5.476 / Base de données virus: 269.10.6/902 - Date: 15/07/2007 14:21