动态数据库驱动的网站与HTML页面

时间:2022-12-05 13:44:40

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

我有一个关于动态数据库驱动的网站的小项目,用户可以在其上发布,评论,等等。而我正在考虑创建HTML页面而不是php页面。例如,在某人发布某个PHP代码后,将为该帖子创建一个html页面,人们可以对其进行评论。在提交评论时,对php页面的ajax调用会将注释数据保存到数据库并将该注释写入html文件。我认为这可能是减少服务器负载的好方法。并有SEO的优势。这种技术有名字吗?它有什么优点或缺点吗?提前致谢

3 个解决方案

#1


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.

有一个名为Kure的平面文件博客引擎。这是一个开源项目,请随时查看。 “平面文件系统”与此技术的名称最接近。

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.

我必须同意我的SO同事。在大多数情况下,服务器甚至个人计算机都能够使用真实数据库处理您所描述的内容。像Wordpress这样的博客引擎非常强大和灵活,可以为您节省大量的麻烦。

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

也就是说,如果你坚持创建自己的平面文件系统......给你带来更大的力量。祝你好运。

#2


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.

例如,Yandex(搜索引擎)使用它来提供其主页面。它是非常丰富的页面,并且需要大量资源才能在每个请求上生成它。

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

此外,还有(至少有)Wordpress的插件可以做到这一点。

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).

如果您的页面是个性化的(即,如果您无法为所有访问者提供同一页面),则无法使用此技术。

#3


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.

我不知道这种技术的名字。我知道它过去已经被用于一些大型网站,但我不确定它是否仍在使用,因为它并不总是易于处理,如果文件由于脚本而损坏,其他使用该页面的脚本可以使其均匀更差。

#1


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.

有一个名为Kure的平面文件博客引擎。这是一个开源项目,请随时查看。 “平面文件系统”与此技术的名称最接近。

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.

我必须同意我的SO同事。在大多数情况下,服务器甚至个人计算机都能够使用真实数据库处理您所描述的内容。像Wordpress这样的博客引擎非常强大和灵活,可以为您节省大量的麻烦。

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

也就是说,如果你坚持创建自己的平面文件系统......给你带来更大的力量。祝你好运。

#2


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.

例如,Yandex(搜索引擎)使用它来提供其主页面。它是非常丰富的页面,并且需要大量资源才能在每个请求上生成它。

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

此外,还有(至少有)Wordpress的插件可以做到这一点。

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).

如果您的页面是个性化的(即,如果您无法为所有访问者提供同一页面),则无法使用此技术。

#3


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.

我不知道这种技术的名字。我知道它过去已经被用于一些大型网站,但我不确定它是否仍在使用,因为它并不总是易于处理,如果文件由于脚本而损坏,其他使用该页面的脚本可以使其均匀更差。