Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the most efficient way of creating dynamic page body? [closed]

I've took a look at the PHP script behind my father website which has been built by a hired programmer. Now, I'm not thinking that I'm better than him, but I think its technique might not be the best.

The website has dynamic page body, in the meaning that my dad can, via a specific admin page, modify the HTML content of most of the webpages in the website. Right now it's made via database: the pages are all stored in the database and every request deals with a query that fetches the page from the database and implement it.

Now, I think this way is very bad mostly because it requires (even if not that expensive if cached) an additional query to the database. Wouldn't it be more efficient to store the pages as HTML files and then just modify the file itself when required? In this way the editing of the file, I think, is faster, and the loading of the content of an html file per request is a lot easier and faster than perform a query.

Is it? Is there any other (more efficient) way to handling this situation?

like image 927
Shoe Avatar asked Jun 28 '12 11:06

Shoe


1 Answers

this is the question of the century :) there is no exact answer to this question. just performance tips. people are working to optimize page load times during recent 30 years.

like image 101
Adem Özgür Avatar answered Oct 21 '22 12:10

Adem Özgür