<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>阅微堂 &#187; HTML</title>
	<atom:link href="http://zhiqiang.org/blog/tag/html/feed" rel="self" type="application/rss+xml" />
	<link>http://zhiqiang.org/blog</link>
	<description>zhiqiang&#039;s personal blog</description>
	<lastBuildDate>Wed, 08 Sep 2010 04:07:10 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>一个新的WordPress静态化插件cos-html-cache</title>
		<link>http://zhiqiang.org/blog/it/a-new-static-wordpress-plug-cos-of-cache-html.html</link>
		<comments>http://zhiqiang.org/blog/it/a-new-static-wordpress-plug-cos-of-cache-html.html#comments</comments>
		<pubDate>Sat, 02 Jun 2007 01:32:33 +0000</pubDate>
		<dc:creator>zhiqiang</dc:creator>
				<category><![CDATA[IT技术]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[WordPress插件]]></category>
		<category><![CDATA[静态化]]></category>

		<guid isPermaLink="false">http://zhiqiang.org/blog/599.html</guid>
		<description><![CDATA[阅微堂是国内WordPress用户较早实现静态化的blog之一。之前，本站所用的是修改WP-Write HTML插件实现的静态化，不过这个插件已经没人维护，我也没时间弄这些玩意儿，所以对一般用户，要想实现静态化也比较麻烦，但现在有了一个新的选择cos-html-cache，目前版本1.0，适用于大多数WP用户，而且作者承诺维护并添加新的功能。
所谓静态化就是生成了所有文章以及首页的HTML版本，...]]></description>
			<content:encoded><![CDATA[<p>阅微堂是国内WordPress用户较早<a href="http://zhiqiang.org/blog/537.html">实现静态化</a>的blog之一。之前，本站所用的是修改<a href="http://ud03.kinoko.name/Archive/545/">WP-Write HTML</a>插件实现的静态化，不过这个插件已经没人维护，我也没时间弄这些玩意儿，所以对一般用户，要想实现静态化也比较麻烦，但现在有了一个新的选择<a href="http://www.storyday.com/html/y2007/958_cos-html-cache-10.html">cos-html-cache</a>，目前版本1.0，适用于大多数WP用户，而且作者承诺维护并添加新的功能。</p>
<p>所谓静态化就是生成了所有文章以及首页的HTML版本，每次访问的时候不需要读取数据库和进行php脚本运算了，所以能够极高的降低CPU占用率，加快访问速度，特别是你装的插件里面有大量类似这样的玩意儿的时候：</p>
<blockquote><p>add_filter("the_content", xxx);</p>
</blockquote>
<p>但只要你把这个插件装上，你就可以放心大胆的装各种各样的插件了，因为这些运算都是一次性的。</p>
<p>这个插件会在你发表新的文章，接到新的留言时，自动更新主页和相关文章的缓存，不用任何手动操作，强烈建议每个人都装上它。</p>
<p>WP-Cache也是一个缓存插件，但实现思路不太一样，下面这个图说明了WP-Cache和完全静态化插件有什么区别（来自<a href="http://www.storyday.com/html/y2007/948_wp-cache-is-not-effective-as-expected.html">wp-cache未必能有多大的效果</a>）：</p>
<p align="center"><img src="http://lh5.google.com/image/china.cos/Rlf3m8N2U8I/AAAAAAAAAjg/392blJPwSFM/s400/cache.jpg"/> </p>
<p>注：某些针对single vistor的插件在此插件下会失效，<strike>pingback失效</strike>（在我这里失效了，但在其<a href="http://storyday.com">作者blog</a>那里能用，原因不明）。</p>
<p></p>
<div><h2>相关文章</h2><ul><li><a href="http://zhiqiang.org/blog/it/the-whole-point-of-static-wordpress.html">WordPress全站静态化</a> <small>继上次把主页静态化后，现在本站所有文章都已经是静态的html页面，跟MT系统差不多，当有新文章或者新留言，相关的html文件在后台自动更新。比如这...</small></li><li><a href="http://zhiqiang.org/blog/it/wordpress-the-revised-calendar-own-style.html">修改wordpress的自带日历式样</a> <small>wordpress自带了一个日历函数get_calendar()，可以显示每天各发了哪些文章（把鼠标移到日期上即可看到），是个很实用的函数。可是它原来的式样太丑了...</small></li><li><a href="http://zhiqiang.org/blog/it/wordpress-create-the-most-efficient-of-all-stations-browsing.html">打造最快捷的wordpress的全站浏览方式</a> <small>我们有很多种方式浏览全站文章，主页面往前翻页，通过察看分类和按日期存档察看，或者通过搜索查找自己敢兴趣的东西。这些方法的缺陷就是太慢...</small></li><li><a href="http://zhiqiang.org/blog/it/the-revised-posted-extend-live-archive-all-stops-for-fast-browsing-article.html">贴出修改过的Extend Live Archive——实现快速全站文章浏览</a> <small>说明：此插件使用需要一定的php, html, css基础。如果你连这些名词都没有听说过的话就不要试了。 

经过两天的修修补补，终于把它弄得可移植了。...</small></li><li><a href="http://zhiqiang.org/blog/it/wordspew-plug-litter-message-solution.html">wordspew插件的垃圾留言的解决办法</a> <small>wordspew插件可以给Blog添加一个实时的ajax聊天窗口，也可以用来当作一个简单留言板，具体效果可见本blog左侧栏的在线聊天模块。本来一直用得挺好的...</small></li><li><a href="http://zhiqiang.org/blog/it/wordpress-accelerate-the-pace-of-pages-printed-in-the-generation-and.html">加快WordPress的页面生成和载入速度</a> <small>前一阵，此blog的页面打开速度慢的要命，我每次打开都需要大约10秒钟的时间。而通过Google Analytics的数据看到，70%+用户在这个blog的停留时间还不到十...</small></li><li><a href="http://zhiqiang.org/blog/it/reading-church-wordpress-plug-in-system-architecture-use.html">阅微堂系统架构 &#038; WordPress插件使用情况</a> <small>本系统使用了以下插件：

	Ajax Comments-Reply: 可以在迴響之後跟隨回覆，使用Ajax無刷新。经过一些修改后，实现本系统的MSN Spaces风格的页面ajax显示和...</small></li><li><a href="http://zhiqiang.org/blog/it/msn-spaces-message-style.html">MSN Spaces留言风格</a> <small>用习惯了MSN Spaces，总是不喜欢其它的包括wordpress默认的留言风格：每次留言都必须到单文章界面去，即使在那里还要忍受提交等待页面刷新的痛苦。所...</small></li><li><a href="http://zhiqiang.org/blog/resource/wordpress-mimetex-used-for-the-plug-in-blog-writing-mathematical-formula.html">用mimetex for wordpress插件在blog上写数学公式</a> <small>上次描述一个算法题目，有两个数列公式，心想要是能直接写Latex公式就好了。今天上网一查，原来实现起来很简单，甚至不需要你在服务器上安装任...</small></li></ul></div>    <p></p>
    <hr noshade style="margin:0;height:1px" />
    <p>&copy; zhiqiang for <a href="http://zhiqiang.org/blog">阅微堂</a>, 2007. | <a href="http://zhiqiang.org/blog/it/a-new-static-wordpress-plug-cos-of-cache-html.html">&#38142;&#25509;</a> | <a href="http://zhiqiang.org/blog/it/a-new-static-wordpress-plug-cos-of-cache-html.html#comments">20 &#26465;&#35780;&#35770;</a></p>]]></content:encoded>
			<wfw:commentRss>http://zhiqiang.org/blog/it/a-new-static-wordpress-plug-cos-of-cache-html.html/feed</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>WordPress全站静态化</title>
		<link>http://zhiqiang.org/blog/it/the-whole-point-of-static-wordpress.html</link>
		<comments>http://zhiqiang.org/blog/it/the-whole-point-of-static-wordpress.html#comments</comments>
		<pubDate>Thu, 15 Mar 2007 06:04:27 +0000</pubDate>
		<dc:creator>zhiqiang</dc:creator>
				<category><![CDATA[IT技术]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[优化]]></category>
		<category><![CDATA[静态化]]></category>

		<guid isPermaLink="false">http://zhiqiang.org/blog/537.html</guid>
		<description><![CDATA[继上次把主页静态化后，现在本站所有文章都已经是静态的html页面，跟MT系统差不多，当有新文章或者新留言，相关的html文件在后台自动更新。比如这篇文章http://zhiqiang.org/blog/536.html是一个服务器上真正的文件，而以前它被rewrite到http://zhiqiang.org/blog/index.php?p=536，HTML页面的创立时间(服务器端)可见页脚：
&#160;
静态化一个好处是，降低数据库查询和CPU占用率，host HTML所用资源...]]></description>
			<content:encoded><![CDATA[<p>继上次把<a href="http://zhiqiang.org/blog/420.html" target="_blank">主页静态化</a>后，现在本站所有文章都已经是静态的html页面，跟MT系统差不多，当有新文章或者新留言，相关的html文件在后台自动更新。比如这篇文章<a href="http://zhiqiang.org/blog/536.html">http://zhiqiang.org/blog/536.html</a>是一个服务器上真正的文件，而以前它被rewrite到<a href="http://zhiqiang.org/blog/index.php?p=536">http://zhiqiang.org/blog/index.php?p=536</a>，HTML页面的创立时间(服务器端)可见页脚：</p>
<p align="center">&nbsp;<a title="footer_time" href="http://www.flickr.com/photos/51234757@N00/421789940/"><img alt="footer_time" src="http://static.flickr.com/158/421789940_d1d5b5fc38.jpg" border="0"></a></p>
<p>静态化一个好处是，降低数据库查询和CPU占用率，host HTML所用资源极少。不过我的主要目的是减少用户访问时的页面载入时间。我很喜欢现在的<a href="http://www.douban.com/" target="_blank">douban</a>，页面基本上即点即开——可能是因为服务器质量和位置比较好。</p>
<p>不知道是不是开了GZip传输的原因，现在页面打开时，需要几秒钟等待，然后页面一下子全开。与我想象中的页面慢慢显示，可以边显示边浏览不一样。另外在FireFox下，有时候背景图片比页面内容晚出现，页面载入完全前特别难看，不知道怎么解决。</p>
<p>实现方法是通过<a href="http://ud03.kinoko.name/Archive/545/" target="_blank">WP-Write HTML</a>这个插件来实现的，不过我hack和删除了90%代码，因为我不需要那么多功能，而且本blog的URL结构比较简单。</p>
<p>静态页面一般不支持COOKIE，不过还有javascript可以用：</p>
<blockquote><p><span style="color: #008000">// Retrieve the value of the cookie with the specified name.</span><br /><span style="color: #0000ff">var</span> aCookie = <span style="color: #0000ff">document</span>.cookie.split("<span style="color: #8b0000">;</span>");<br /><span style="color: #0000ff">function</span> GetCookie(sName, id)<br />{<br />&nbsp;&nbsp;&nbsp; <span style="color: #008000">// cookies are separated by semicolons</span><br />	<span style="color: #0000ff">var</span> something = <span style="color: #0000ff">document</span>.getElementById(id);<br />	<span style="color: #0000ff">if</span>(!something) <span style="color: #0000ff">return</span> 0;<br />&nbsp;&nbsp;&nbsp; 	<span style="color: #0000ff">for</span> (<span style="color: #0000ff">var</span> i=0; i &lt; aCookie.<span style="color: #0000ff">length</span>; i++)<br />&nbsp;&nbsp;&nbsp; 	{<br /><span style="color: #008000">// a name alue pair (a crumb) is separated by an equal sign</span><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 	<span style="color: #0000ff">var</span> aCrumb = aCookie[i].split("<span style="color: #8b0000">=</span>");<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 	<span style="color: #0000ff">if</span> (sName == aCrumb[0]){<br />			something.value=<span style="color: #0000ff">unescape</span>(aCrumb[1]);<br />			<span style="color: #0000ff">return</span> 1;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 	}<br />&nbsp;&nbsp;&nbsp; 	}<br /><span style="color: #008000">// a cookie with the requested name does not exist</span><br />&nbsp;&nbsp; 	<span style="color: #0000ff">return</span> 0;<br />}</p>
</blockquote>
<p>这次系统升级是看到<a href="http://www.storyday.com/web-tech/576/cache-machanism-of-mysite" target="_blank">关于本站缓存机制的说明</a>这篇文章后做出的，不过所用方法不同。另外还有一篇<a href="http://blog.znsunimage.com/2007/03/11/504" target="_blank">WordPress的优化手册</a>也值得一看，特别是最后的image meta部分。</p>
<p>另注：Firefox的<a href="http://fasterfox.mozdev.org/" target="_blank">fasterfox</a>插件能在右下角显示网页载入所需时间。</p>
<p></p>
<div><h2>相关文章</h2><ul><li><a href="http://zhiqiang.org/blog/it/wordpress-accelerate-the-pace-of-pages-printed-in-the-generation-and.html">加快WordPress的页面生成和载入速度</a> <small>前一阵，此blog的页面打开速度慢的要命，我每次打开都需要大约10秒钟的时间。而通过Google Analytics的数据看到，70%+用户在这个blog的停留时间还不到十...</small></li><li><a href="http://zhiqiang.org/blog/it/a-new-static-wordpress-plug-cos-of-cache-html.html">一个新的WordPress静态化插件cos-html-cache</a> <small>阅微堂是国内WordPress用户较早实现静态化的blog之一。之前，本站所用的是修改WP-Write HTML插件实现的静态化，不过这个插件已经没人维护，我也没时间...</small></li><li><a href="http://zhiqiang.org/blog/it/blog-fast-download-speeds-to-be-faster-and-the-speed-of-blog.html">blog下载速度多快才算快和blog速度优化</a> <small>很多人有一个大致的感觉，某blog很慢，或者有点慢，但是似乎还过得去，而没有一个量化的指标。其实对于FireFox浏览器，使fastfox插件，可以在右下方...</small></li><li><a href="http://zhiqiang.org/blog/it/wordspew-plug-litter-message-solution.html">wordspew插件的垃圾留言的解决办法</a> <small>wordspew插件可以给Blog添加一个实时的ajax聊天窗口，也可以用来当作一个简单留言板，具体效果可见本blog左侧栏的在线聊天模块。本来一直用得挺好的...</small></li><li><a href="http://zhiqiang.org/blog/it/bbpress-installation-problems-and-several-plug-ins.html">bbPress的安装问题和几个插件</a> <small>演示地址：http://zhiqiang.org/bbs/.

bbPress是一个微型论坛程序，官方主页 http://bbpress.org，与WordPress是同一批人开发维护的。主要特点是简洁，且与WordPress...</small></li><li><a href="http://zhiqiang.org/blog/it/my-experiences-and-views-blog.html">我的Blog经历和一些看法</a> <small>我是从去年3月开始接触Blog的，最开始注册在MSN Spaces上面，中途见异思迁了一次，搬到sina blog上去了，不过后来还是搬回去了。到今年4月，觉得MSN Space...</small></li><li><a href="http://zhiqiang.org/blog/it/wordpress-chinese-translation-of-documents-initiative.html">WordPress中文文档翻译倡议</a> <small>这是一封WordPress中文文档翻译倡议书。&nbsp;希望大家对倡议书所及内容发表意见和建议，并尽个人所能参与到WordPress中文文档翻译计划中来，谢谢大家...</small></li><li><a href="http://zhiqiang.org/blog/it/wordpress-upgrade-to-the-23-change-permalink.html">WordPress升级到2.3 &amp; 更改permalink</a> <small>趁周末把WordPress升级到了2.3。 这次版本更新的重大改动有两个，一个是Tag的引入，另一个category相关的3个数据库改动比较大，后面这个很致命，只要读...</small></li><li><a href="http://zhiqiang.org/blog/it/to-get-gibberish-wordpress-move-to-dreamhost.html">搞定乱码，WordPress搬家到dreamhost</a> <small>两个月前一时冲动，花了大约80大洋买了一年的dreamhost主机。刚买的时候就试图把Blog搬到它上面去，不过由于数据库的乱码原因，一直没有成功。最近...</small></li><li><a href="http://zhiqiang.org/blog/it/let-windows-live-writer-support-tag-of-wordpress-23.html">Windows Live Writer支持WordPress 2.3的tag的方法（不用插件）</a> <small>下载这个文件，解压后上传到blog的根目录，之后WLW编辑区域下面的高级选项里多出了一个keywords选项，里面就对应着WP2.3的Tag!  不是我写的...</small></li></ul></div>    <p></p>
    <hr noshade style="margin:0;height:1px" />
    <p>&copy; zhiqiang for <a href="http://zhiqiang.org/blog">阅微堂</a>, 2007. | <a href="http://zhiqiang.org/blog/it/the-whole-point-of-static-wordpress.html">&#38142;&#25509;</a> | <a href="http://zhiqiang.org/blog/it/the-whole-point-of-static-wordpress.html#comments">42 &#26465;&#35780;&#35770;</a></p>]]></content:encoded>
			<wfw:commentRss>http://zhiqiang.org/blog/it/the-whole-point-of-static-wordpress.html/feed</wfw:commentRss>
		<slash:comments>42</slash:comments>
		</item>
	</channel>
</rss>
