[thelist] Tip: using PHP to collate and cache several JavaScript includes.

Christian Heilmann codepo8 at gmail.com
Thu Dec 14 07:30:19 CST 2006


<tip type-"page performance tool">
Ed Elliot came up with a cool PHP script that allows you to create a
single cached include automatically from all the JavaScripts or CSS
files you want to include.

http://www.ejeliot.com/blog/72

For those who wonder why the hey you'd want to do this: working on
high traffic sites means you learn a lot about how to make pages
perform. Every HTTP request sent from page results in another DNS
lookup and generally slows down the perceived loading time of the
page. Furthermore, scripts loaded in the head of the document get
loaded first and add to the whole page loading time as browsers start
rendering after all the dependencies in the head were loaded.
Using Ed's script means you can have the maintenance benefit of
different includes without having to worry about the performance
problems.
</tip>
-- 
Chris Heilmann
Book: http://www.beginningjavascript.com
Blog: http://www.wait-till-i.com
Writing: http://icant.co.uk/



More information about the thelist mailing list