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,
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,