Pregunta

<?php include ('big_file.php');?>

big_file is about 25 KB, text only, and it is very uncomfortable for handling and editing.

If I split it into chapters, I got five smaller files, each about 7 KB and it seems there is no difference in time loading the page on localhost.

But still, is there any downside of this solution, especially about time loading on remote server?

¿Fue útil?

Solución

The difference when including one big file or just parts of the same file multiple times will be negligible to non-existent on local server (via local filesystem).

You also mention including files from remote server, then including multiple will make a difference over one, as for every include the server will make a separate request and that will bring extra overhead.

Also, if you expect to include .php source files over remote, then it will not workas .php files are parsed on the server side, so you will only be able to include the output of parsed .php files on remote server.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top