Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SSI or PHP Include()?

basically i am launching a site soon and i predict ALOT of traffic. For scenarios sake, lets say i will have 1m uniques a day. The data will be static but i need to have includes aswell

I will only include a html page inside another html page, nothing dynamic (i have my reasons that i wont disclose to keep this simple)

My question is, performance wise what is faster

<!--#include virtual="page.htm" -->

or

<?php include 'page.htm'; ?>
like image 318
Ozzy Avatar asked Jun 07 '10 23:06

Ozzy


2 Answers

Performance wise fastest is storing the templates elsewhere, generating the full HTML, and regenerate based on alterations in your template.

If you really want a comparison between PHP & SSI, I guess SSI is probably faster, and more important: not having PHP is a lot lighter on RAM needed on the webservers processes/threads, thereby enabling you to have more apache threads/processes to serve requests.

like image 191
Wrikken Avatar answered Nov 12 '22 13:11

Wrikken


SSI is built in to Apache, while Apache has to spawn a PHP process to process .php files, so I would expect SSI to be somewhat faster and lighter.

I'll agree with the previous answer, though, that going the PHP route will give you more flexibility to change in the future.

Really, any speed difference that exists is likely to be insignificant in the big picture.

like image 2
John Flatness Avatar answered Nov 12 '22 13:11

John Flatness