Dev01 Posted November 18, 2008 Share Posted November 18, 2008 Hi Does using the PHP include function for header, menu etc etc help loading times or does it mean more HTTP requests when a page loads each time? Thanks very much Dev01 Link to comment https://forums.phpfreaks.com/topic/133171-php-include-does-it-help-loading-times/ Share on other sites More sharing options...
waynew Posted November 18, 2008 Share Posted November 18, 2008 I don't think so... unless of course the file it is trying to include doesn't exist... Anyway, I doubt that you'll ever have to worry about this. Link to comment https://forums.phpfreaks.com/topic/133171-php-include-does-it-help-loading-times/#findComment-692584 Share on other sites More sharing options...
JasonLewis Posted November 18, 2008 Share Posted November 18, 2008 The only thing it does is separates each different section of the website into smaller, more manageable files. I wouldn't think it'd affect the loading time, you could certainly perform some tests if your that worried. Link to comment https://forums.phpfreaks.com/topic/133171-php-include-does-it-help-loading-times/#findComment-692587 Share on other sites More sharing options...
emma57573 Posted November 18, 2008 Share Posted November 18, 2008 I dont think so as the code is still going into your page its just being called for instead. Link to comment https://forums.phpfreaks.com/topic/133171-php-include-does-it-help-loading-times/#findComment-692592 Share on other sites More sharing options...
Dev01 Posted November 20, 2008 Author Share Posted November 20, 2008 Thanks everyone for the replies. I know it makes managing the content easier, however, I wondered, by including the PHP include function, the pages do not have to reload those sections when a new page is selected. Now I think about it though, a HTTP request still has to be made when it loads to get the info from the include file! So I kind of answered my own question! Thanks very much, problem sorted. Regards to all Link to comment https://forums.phpfreaks.com/topic/133171-php-include-does-it-help-loading-times/#findComment-694758 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.