Hacker News new | ask | show | jobs
by clusterfu_k 5945 days ago
Firstly, I have no control over the server. In fact I've been trying to get them to install Python on there for me but I can't even get that.

I understand why loading the page would be faster if it was all in one file. Also, I realise that this would not allow for the dynamic page to be cached properly for future use, but I have tested and the effects of the lack of caching are minimal.

So the question is what are the downsides of doing it this way?

1 comments

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.

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?