2

I'm currently working on a website in which some pages are written in PHP, but not all of them.
I'm considering including the menu as a PHP file (so when the menu has to be changed I only have to change it in one file, instead of all my pages). But that requires converting my HTML pages into PHP.

Aside from the fact that changing for example the menus will be easier, will it make a difference in loading time at the clients side?

Just curious if it will make a noticeable difference.

5
  • 3
    Short answers is - yes, there will be a difference. Whether is noticeable or not - you have to measure because there exists no person in this world who can tell you what the difference will be. Commented Dec 9, 2014 at 9:52
  • 1
    please check this : differencebetween.info/difference-between-php4-and-php5 Commented Dec 9, 2014 at 9:53
  • You're more likely to experience excess load times with frontend assets than a basic PHP setup Commented Dec 9, 2014 at 9:53
  • A very little, what is really negligible. Commented Dec 9, 2014 at 9:53
  • Also notice that, you have not rewrite your html to php. You can configure your web server to parse html as php. Commented Dec 9, 2014 at 9:55

3 Answers 3

4

It won't make any noticeable difference unless you add very heavy calculation or bad code inside. For include only and maybe some appearances of if and echo it won't make any difference that you could notice.

Sign up to request clarification or add additional context in comments.

3 Comments

Any drawbacks when using a php file instead of a html? (lets say they have the same content)
@Lisa drawbacks nothing.. HTML file direct load from path, but .php file first process from PHP compiler and then provide HTML on client side.
None I can think of. Both are plain txt files. When server is conifgured to parse html files you don't even have to rewrite their extensions.
1

The load times will be slightly longer as each of the PHP files needs to be processed in order to generate the HTML which the browser can render. It would also need to load each included file for the page too.

The "slightly longer" won't amount to anything noticeable, it will be fractions of a second for the server to respond.

Comments

0

Will there be difference? Yes.

Noticeable by human? No.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.