oOPurple_HazeOo
oOPurple_HazeOo

Reputation: 37

Should I use PHP include?

I am building a site and I have used a bunch of php includes to a lot of page sections to try keep my code tidy.

While reading a beginners book on Javascript it said that I should keep my external javascript files down to a minimum because every time the client loads a file it makes a new request to the server thus slowing down the page speed.

So my question is if I have a bunch of php include files on one page is it the same principle? It probably is right?

Upvotes: 0

Views: 280

Answers (1)

Sjon
Sjon

Reputation: 5155

It is not the same principle, javascript files are downloaded and interpreted by the client; which is why you want to keep their size and number low (since bandwidth is limited).

PHP files are not downloaded by the client; they are interpreted by the server where you upload them; their output will be send to the client. This is why the number of PHP files does not have a negative impact on your page in the same way as javascript does

Upvotes: 4

Related Questions