3

I have a small project about a dynamic database driven website which is users can post, comment, like,... on it.
and I was thinking about creating html pages instead of php pages.
for example after someone posts sth a php code will create a html page for that post and people can comment on it. while submitting a comment, an ajax call to a php page will save comment data to database and write that comment to the html file.
I thought it could be a good way to reduce server load. and have advantages for SEO.
Does this technique have a name? and Does it have any more advantages or disadvantages?
Thanks in advance

2
  • 3
    and have advantages for SEO. No it does not. Commented Dec 25, 2011 at 16:41
  • 2
    @PeeHaa, it could in theory affect your Google Rank, since it is affected by page load speed. If the static version is significantly faster than the dynamically rendered counterpart, the static will get higher scores. Commented Dec 25, 2011 at 17:46

3 Answers 3

4

There's a flat-file blogging engine called Kure. It's an open-source project so feel free to check it out. "Flat file system" would be the closest thing to a name for this technique.

I have to agree with my SO colleagues here. Servers and even personal computers are, for the most part, more than capable to handling what you're describing using a real database. Blogging engines such as Wordpress, are incredibly powerful and flexible and will save you a lot of hassle down the line.

That said, if you insist in creating your own flat-file system... more power to you. Good luck.

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

2 Comments

thanks! at this part "Servers and even personal computers are, for the most part, more than capable to handling what you'r describing using a real database" do you mean updating the static copies will have very high resource usage like what Sergei Tulentsev said?
Actually, I meant they're capable enough of handling a relational database (as in there's rarely a need to go the flat-file system route to lessen the server's load).
3

Yes, it is a known technique for optimizing serving of relatively static pages. By 'relatively static' I mean "dynamic, but update rarely".

For example, Yandex (a search engine) uses this to serve its main page. It's pretty rich page, and it would require significant resources to generate it on each request.

Also, there is (at least, there was) a plugin for Wordpress that does this.

You can't use this technique if your pages update often (it will not worth it).

You can't use this technique if your pages are personalized (that is, if you can't serve the very same page to all your visitors).

2 Comments

thanks for your answer. It has some good information. but what do you mean by > it will not worth it ? do you mean high server resource usage or coding difficulties here or something else?
If update rate is high, you will spend more resources on updating those static copies than you save by doing that. (and yes, not to mention more complicated code)
1

I don't know any name for this technique. I know it's already been used for some big sites in the past but I'm not sure it's still used because it's not always easy to handle and if a file is corrupted because of a script, other scripts working with the page can make it even worse.

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.