Originally posted by epp_b
So, my question is: does cutting the size of a PHP file reduce bandwidth & loading time, or is what I'm doing here simply impractical?
Not bandwidth; as far as the 'Net and the browser are concerned, it's just one HTML file that's getting sent anyway, in God only knows how many packets.... Now, if some of those 10,000 lines are blank lines of output, it might use bw...
The issue that PHP does deal with is server response time. Unfortunately, I don't know if any studies have been done on how "one big script" vs. "includes of four little scripts" affects response time. I would actually guess that it's a slightly negative hit using smaller included files, but I imagine that it's so negligible as to be unworthy of such a long sentence as this... 😃 Remember that when you "include", you simply make the PHP compiled script out of the "included" files and original script instead of the original script itself. I suppose that if your "include" files have lots of functions in them that aren't used in any given script, the resulting PHP script would actually be larger and use more memory and CPU than otherwise. However, it's a heck of a lot more convenient having includes in most cases, and many folks do it, so I'm thinking, as I said, that the performance hit is relatively small, comparatively speaking....
The real problem for us as coders is simply making apps that parse quickly, compile quickly, and send their data quickly, and that simply means efficient coding practices (of which I am not a master....) :rolleyes: