Jump to content

[SOLVED] Include and require question.


zavin

Recommended Posts

I read some place that it is a bad idea to store a lot of information in an included or required page because it could slow down the loading of the page. For example if I had 100 custom error messages all written in errors.php and for every page the needed some of these error messages I would include errors.php. Now are all 100 error messages going to load into memory every time the page is included or an error is called from the page?

Link to comment
https://forums.phpfreaks.com/topic/152409-solved-include-and-require-question/
Share on other sites

Yes, it will load that page into memory on the server and look through it.  100 error messages isn't something I'd worry about, however. 

 

However, if these 100 messages can be categorized and only loaded in specific places, then it probably wouldn't hurt to do it.  Loading that up on a page that will have no errors is just inefficient.  Then again, I've seen worse coding.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.