Since I have large websites, I would like to use "include php" for future updating my sites easily and fast. I test to include serveral php in my .html sites, I found that webpage downloading become slow. Is that normal or can I have some way to modify, then won't affect webpage download ? Thanks for your input, HG
Using Server side scripting will always slow you down... Sorry Your server has to process the code on the page before sending the html
Hmm, it shouldn't make any noticeable effect to download times. Is there much PHP code in the includes? Does this code require much CPU usage?
Normally the waiting time increases only a millisecond or two... Of course that depends on what kind of website, includes, sql queries, etc etc etc...
i would not think that using 'includes' would be noticably slower. in fact, if the same pieace of code gets use in many places, i would think using 'includes' is encouraged to make your code more manageable. even if you 'includes' contain code that performs a task (e.g. querying a database), actually putting the code into the main php file would also cause the slowdown... and by the way, 'includes' could include scripts that perform some server side processing, but 'includes' is not equal to server side scripting...
just using an include shouldn't affect your speed much if at all. The CPU time needed to process that is miniscule. You might look to what you are including... database access, large piece of code, giant file etc. will slow things down, but a simple include affects things very little.
Much agreed, the time it takes to parse things server side is extremley fast. As stated, large databases and stuff like that might slow it down considerably. All in all, it shouldn't be bad. Why, do you notice a lag? Show a url and i'll test it and let you know if it is slow on my end too.
A plain text include takes less than a millisecond to execute, even on an average machine. Most properly designed simple DBMS queries will execute in 5 ms or less. If you see noticeable slowdown, there's something wrong with your setup. J.D.
I think there is some confusion here over people who use WYSIWYG editors and people who understand scripting. Obviously a php include is a server side script, but Frontpage also now writes includes that are also server side, you just don't have to understand them any longer as it is all automated. As has been posted here, as server side script if it is a simple include of a navigation structure etc should not slow down the page load by any noticable volume. Even if it is pulling information dynamically, it should not slow the page down any more than the original hard coded dynamic request would have. maybe a little more information about the funtion of the include would clear the muddy waters .
Thanks for all response. Really appreciate. I add 6 "include php" scripts into .html webpages. All php scripts are pretty simple php. Two of them try to dynamically retrieve content on the net, small size, not heavy content. Rest of php scripts just simply retrieve my html page's content. I did some test again. Slow downloading is not all the time, might related to server, my computer, traffic hours, etc. I am afraid to slow webpage downloading if I add more include php scripts? Thanks HG
Get two time stamps, one at the beginning of the page and one at the end of the page and output the difference (in milliseconds or microseconds). This will give you a pretty good idea of how fast (or slow) your includes are. J.D.
I agree with the common thought. It's not that you are "including" that is slowing you down. It's what you "including" that is slowing you down.
That will slow things down for sure. Consider storing them in a data base with a timestamp and only retrieve new copies if the timestamp is more than an hour or two old.
hi, i think that 'include' wont make page download time slow (may be in milli secs). bcoz the program is getting include file from its own hard drive, but it may depend upon the size and process... -------------- gullam18 Powering web hosting company in india.
They could very well be slow because they are trying to retrieve content from elsewhere. 1) you have no idea what your outbound bandwidth is. It could be limited, or there could be hundreds of scripts doing the same thing on your server. 2) you are relying on the speed of the server you are retrieving content from. Many servers are set up to only allow two sessions at a time from a single IP to prevent a single user from bogging down there server by downloading things.