News for hackers. Stuff that matters.
Re:Ask HN: Include JavaScript via PHP or HTML? by alttab on Wednesday March 10, 2010 @11:42PM (#1182993)
In a second and real answer to your question, the file should only require the second HTTP request the first time. Any subsequent inclusions of that file won't go to the server to get it.

The downside is it makes each page bigger. If isn't a real small javascript file, you are adding all those bytes to each request. In this case, it would require more bandwidth to transfer the entire page at the same speed.

Re:Ask HN: Include JavaScript via PHP or HTML? by clusterfu_k on Thursday March 11, 2010 @12:00AM (#1183035)
if the time it takes to download the slightly page is less than the time it takes for the second request for a separate js file on average (including when cached), then i would be in the clear?