I am trying to cache js files on server side and came across this link.
The whole idea is to get contents of all js files to be cached and write to a separate file which is also having a .js extension.
What I am not able to get is that, the cache file created is just another js file. How is it different from normal js files. To me it was like combing all js files into one big js files and output as a buffer. Also is it not increasing the code/text ratio because of this. Please help me understand and also to avoid the increase in code/text ratio.
I searched a lot on google and this site for answers and not able to get anything even close. So please downvote.
the purpose of this is to reduce the number of connections to the server. In this approach there is one large .js file download, rather than a bunch of smaller ones. Presumably you will adjust your php to include only the js files that you actually need.