Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is it best to require a large file or more calls to fewer files? 1

Status
Not open for further replies.

JohnnyT

Programmer
Jul 18, 2001
167
GB
Hi all,
I'm trying to optimise my website. I have a large "functions" file. It is 'included' on every page. Is there any speed gain to having one large functions.php file OR is it faster to have an include file that checks what page the visitor is on and then 'includes' a specific small functions file based on that page.

i.e. which is quicker...

1 File:
function myFuncOne() {}
function myFuncTwo() {}
...
function myFuncHundred() {}

OR...
Several files:
if(page == "registration") {
include("registration_functions.php");
}
if(page == "profile"){
include("profile_functions.php");
}

Does anyone know whether there is any significant difference between these two methods in terms of web page speed etc

Cheers

JT ;-)

Spend a few minutes remembering your loved ones,
Create a permanent memorial to commemorate their life,

 
then you would need mod_rewrite or an actual file in place for each 'action'.

honestly i cannot see that this provides better protection than using the querystring.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top