Home  >  Article  >  Backend Development  >  cms是如何大批量生成.html静态文件的?

cms是如何大批量生成.html静态文件的?

WBOY
WBOYOriginal
2016-06-06 20:16:271342browse

php生成静态我是会的,但是像cms这种批量生成数以万记的html静态文件,不是太明白。

回复内容:

php生成静态我是会的,但是像cms这种批量生成数以万记的html静态文件,不是太明白。

通常一个 PHP 进程是很难在秒级生成数万个 html

小技巧,某些 CMS 为快速生成,在页面中会使用 iframe 同时访问多个 PHP 进生成:

<code><!-- 生成id 1-1000 的html -->
<iframe style="display:none" src="makehtml.php?id=1-1000"></iframe>

<!-- 生成id 1001-2000 的html -->
<iframe style="display:none" src="makehtml.php?id=1001-2000"></iframe>

....</code>

大多是生成内容,按着主键索引生成内容其实也是很快.
ob_*

cms数以万计的生成静态不见得就很快,它们也是循环去生成的

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn