So, recently, after accruing quite a few js and css files, I began thinking about all of the http calls I was making.
Since I use PHP inlcude for the page headers and footers, every page was calling every script which was really inefficient. So I started using conditional statements in the pages with php to call only the needed files.
Then I thought, hey, wouldn't it be smarter to cut down on all of these http calls (even now every page has more than a few external js or css files) by making one huge css.php, and one huge js.php, and just include them in the header and footer respectively, and use conditional statements within those files?
The end result would be that those large files would be processed server side, and each page would get its css directly in the head and jss directly in the bottom of the body, with all of the code it needs and no more than that.
Is there any reason not to do this? Any thoughts in general on this idea? Is everyone else already doing this and I just missed the boat?