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

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

WBOY
Release: 2016-06-06 20:16:27
Original
1380 people have browsed it

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>
Copy after login

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

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template