<?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>A Tempest of Thoughts &#187; Wordpress</title>
	<atom:link href="http://tempe.st/category/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://tempe.st</link>
	<description>aka blog.to_int(:inig)</description>
	<lastBuildDate>Thu, 13 May 2010 09:54:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>WordPress + Lighttpd + WP-Supercache + Mobile Support</title>
		<link>http://tempe.st/2009/11/wordpress-lighttpd-wp-supercache-mobile-support/</link>
		<comments>http://tempe.st/2009/11/wordpress-lighttpd-wp-supercache-mobile-support/#comments</comments>
		<pubDate>Sat, 28 Nov 2009 16:35:10 +0000</pubDate>
		<dc:creator>Giovanni Intini</dc:creator>
				<category><![CDATA[Lua]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[lighttpd]]></category>
		<category><![CDATA[wp-supercache]]></category>

		<guid isPermaLink="false">http://tempe.st/?p=305</guid>
		<description><![CDATA[Last year I made some work on lighttpd support for wp-supercache. It instantly became very popular and basically anyone running wordpress on lighttpd uses it, even if it lacks support for wp-supercache newest features. The amazing Jean Pierre Wenzel has recently released an updated version that adds a much needed mobile support. You can check [...]]]></description>
			<content:encoded><![CDATA[	<p>Last year I made <a href="http://tempe.st/2008/05/lightning-speed-wordpress-with-lighttpd-and-supercache-part-ii/">some work</a> on lighttpd support for wp-supercache. It instantly became very popular and basically anyone  running wordpress on lighttpd uses it, even if it lacks support for wp-supercache newest features.</p>
	<p>The amazing <a href="http://github.com/jpwenzel">Jean Pierre Wenzel</a> has recently released an updated version that adds a much needed mobile support.</p>
	<p>You can check it out <a href="http://github.com/jpwenzel/wp-lighttpd-rewrite">here.</a></p>
	<p>Thanks Jean Pierre!</p>


 ]]></content:encoded>
			<wfw:commentRss>http://tempe.st/2009/11/wordpress-lighttpd-wp-supercache-mobile-support/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lightning speed WordPress with Lighttpd and Supercache, part II</title>
		<link>http://tempe.st/2008/05/lightning-speed-wordpress-with-lighttpd-and-supercache-part-ii/</link>
		<comments>http://tempe.st/2008/05/lightning-speed-wordpress-with-lighttpd-and-supercache-part-ii/#comments</comments>
		<pubDate>Mon, 05 May 2008 09:13:44 +0000</pubDate>
		<dc:creator>Giovanni Intini</dc:creator>
				<category><![CDATA[Lua]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[lighttpd]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[wp-supercache]]></category>

		<guid isPermaLink="false">http://tempe.st/?p=210</guid>
		<description><![CDATA[There was an error in the code I wrote for my previous post about lighttpd and wp-supercache. If you kept GZip disabled in you wp-supercache configuration, and your browser sent an Accepts gzip header, lightpress would serve the dynamic page (instead of the cached html page). I did some refactoring and testing, and here&#8217;s the [...]]]></description>
			<content:encoded><![CDATA[	<p>There was an error in the code I wrote for my previous post about <a href="http://tempe.st/2008/04/lighttpd-and-wp-supercache-now-you-can/">lighttpd and wp-supercache</a>. If you kept GZip disabled in you wp-supercache configuration, and your browser sent an Accepts gzip header, lightpress would serve the dynamic page (instead of the cached html page). </p>
	<p>I did some refactoring and testing, and here&#8217;s the current version of rewrite.lua. This one will serve the correct gzipped or text content, while solving another bug with urls ending in &#8221;/&#8221;:</p>

<div class="wp_syntax"><div class="code"><pre class="lua" style="font-family:monospace;"><span style="color: #b1b100;">function</span> serve_html<span style="color: #66cc66;">&#40;</span>cached_page<span style="color: #66cc66;">&#41;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>lighty.stat<span style="color: #66cc66;">&#40;</span>cached_page<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">then</span>
    lighty.env<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;physical.path&quot;</span><span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">=</span> cached_page
    <span style="color: #b1b100;">print</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Serving cached page: &quot;</span> .. cached_page<span style="color: #66cc66;">&#41;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #b1b100;">true</span>
  <span style="color: #b1b100;">else</span>
    <span style="color: #b1b100;">return</span> <span style="color: #b1b100;">false</span>
  <span style="color: #b1b100;">end</span>
<span style="color: #b1b100;">end</span>
&nbsp;
<span style="color: #b1b100;">function</span> serve_gzip<span style="color: #66cc66;">&#40;</span>cached_page<span style="color: #66cc66;">&#41;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>lighty.stat<span style="color: #66cc66;">&#40;</span>cached_page .. <span style="color: #ff0000;">&quot;.gz&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">then</span>
    lighty.header<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;Content-Encoding&quot;</span><span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">&quot;gzip&quot;</span>
    lighty.header<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;Content-Type&quot;</span><span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">&quot;&quot;</span>
    lighty.env<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;physical.path&quot;</span><span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">=</span> cached_page .. <span style="color: #ff0000;">&quot;.gz&quot;</span>
    <span style="color: #b1b100;">print</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Serving gzipped page: &quot;</span> .. cached_page .. <span style="color: #ff0000;">&quot;.gz&quot;</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #b1b100;">true</span>
  <span style="color: #b1b100;">else</span>
    <span style="color: #b1b100;">return</span> <span style="color: #b1b100;">false</span>
  <span style="color: #b1b100;">end</span>
<span style="color: #b1b100;">end</span>
&nbsp;
attr <span style="color: #66cc66;">=</span> lighty.stat<span style="color: #66cc66;">&#40;</span>lighty.env<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;physical.path&quot;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">not</span> attr<span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">then</span>
  lighty.env<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;uri.path&quot;</span><span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">&quot;/index.php&quot;</span>
  lighty.env<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;physical.rel-path&quot;</span><span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">=</span> lighty.env<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;uri.path&quot;</span><span style="color: #66cc66;">&#93;</span>
  lighty.env<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;physical.path&quot;</span><span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">=</span> lighty.env<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;physical.doc-root&quot;</span><span style="color: #66cc66;">&#93;</span> .. lighty.env<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;physical.rel-path&quot;</span><span style="color: #66cc66;">&#93;</span>
&nbsp;
  query_condition <span style="color: #66cc66;">=</span> <span style="color: #b1b100;">not</span> <span style="color: #66cc66;">&#40;</span>lighty.env<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;uri.query&quot;</span><span style="color: #66cc66;">&#93;</span> <span style="color: #b1b100;">and</span> <span style="color: #b1b100;">string.find</span><span style="color: #66cc66;">&#40;</span>lighty.env<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;uri.query&quot;</span><span style="color: #66cc66;">&#93;</span>, <span style="color: #ff0000;">&quot;.*s=.*&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
  user_cookie <span style="color: #66cc66;">=</span> lighty.request<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;Cookie&quot;</span><span style="color: #66cc66;">&#93;</span> <span style="color: #b1b100;">or</span> <span style="color: #ff0000;">&quot;no_cookie_here&quot;</span>
  cookie_condition <span style="color: #66cc66;">=</span> <span style="color: #b1b100;">not</span> <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">string.find</span><span style="color: #66cc66;">&#40;</span>user_cookie, <span style="color: #ff0000;">&quot;.*comment_author.*&quot;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">or</span> <span style="color: #b1b100;">string.find</span><span style="color: #66cc66;">&#40;</span>user_cookie, <span style="color: #ff0000;">&quot;.*wordpress.*&quot;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">or</span> <span style="color: #b1b100;">string.find</span><span style="color: #66cc66;">&#40;</span>user_cookie, <span style="color: #ff0000;">&quot;.*wp-postpass_.*&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>query_condition <span style="color: #b1b100;">and</span> cookie_condition<span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">then</span>
    accept_encoding <span style="color: #66cc66;">=</span> lighty.request<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;Accept-Encoding&quot;</span><span style="color: #66cc66;">&#93;</span> <span style="color: #b1b100;">or</span> <span style="color: #ff0000;">&quot;no_acceptance&quot;</span>
    cached_page <span style="color: #66cc66;">=</span> lighty.env<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;physical.doc-root&quot;</span><span style="color: #66cc66;">&#93;</span> .. <span style="color: #ff0000;">&quot;/wp-content/cache/supercache/&quot;</span> .. lighty.request<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;Host&quot;</span><span style="color: #66cc66;">&#93;</span> .. lighty.env<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;request.uri&quot;</span><span style="color: #66cc66;">&#93;</span> .. <span style="color: #ff0000;">&quot;/index.html&quot;</span>
    cached_page <span style="color: #66cc66;">=</span> <span style="color: #b1b100;">string.gsub</span><span style="color: #66cc66;">&#40;</span>cached_page, <span style="color: #ff0000;">&quot;//&quot;</span>, <span style="color: #ff0000;">&quot;/&quot;</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">string.find</span><span style="color: #66cc66;">&#40;</span>accept_encoding, <span style="color: #ff0000;">&quot;gzip&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">then</span>
      <span style="color: #b1b100;">if</span> <span style="color: #b1b100;">not</span> serve_gzip<span style="color: #66cc66;">&#40;</span>cached_page<span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">then</span> serve_html<span style="color: #66cc66;">&#40;</span>cached_page<span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">end</span>
    <span style="color: #b1b100;">else</span>
      serve_html<span style="color: #66cc66;">&#40;</span>cached_page<span style="color: #66cc66;">&#41;</span>
    <span style="color: #b1b100;">end</span>
  <span style="color: #b1b100;">end</span>
<span style="color: #b1b100;">end</span></pre></div></div>



 ]]></content:encoded>
			<wfw:commentRss>http://tempe.st/2008/05/lightning-speed-wordpress-with-lighttpd-and-supercache-part-ii/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Lighttpd and WP-Supercache? Now you can!</title>
		<link>http://tempe.st/2008/04/lighttpd-and-wp-supercache-now-you-can/</link>
		<comments>http://tempe.st/2008/04/lighttpd-and-wp-supercache-now-you-can/#comments</comments>
		<pubDate>Thu, 24 Apr 2008 13:53:45 +0000</pubDate>
		<dc:creator>Giovanni Intini</dc:creator>
				<category><![CDATA[Lua]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[lighttpd]]></category>
		<category><![CDATA[wp-cache]]></category>
		<category><![CDATA[wp-supercache]]></category>

		<guid isPermaLink="false">http://tempe.st/?p=202</guid>
		<description><![CDATA[Update: there are some bugs with this code. You can find the newest (and best) version here It&#8217;s often said that if you can&#8217;t find something in Google it doesn&#8217;t exist, and when I couldn&#8217;t find a way to serve WP-Supercached pages via Lighttpd I was pretty sure no one had ever published on the [...]]]></description>
			<content:encoded><![CDATA[	<p><strong>Update:</strong> there are some bugs with this code. You can find the newest (and best) version <a href="http://tempe.st/2008/05/lightning-speed-wordpress-with-lighttpd-and-supercache-part-ii/">here</a></p>
	<p>It&#8217;s often said that if you can&#8217;t find something in Google it doesn&#8217;t exist, and when I couldn&#8217;t find a way to serve <a href="http://ocaoimh.ie/wp-super-cache/">WP-Supercache</a>d pages via Lighttpd I was pretty sure no one had ever published on the net a solution to my problem.</p>
	<p>Nice permalinks were easy to fix, thanks to <a href="http://sudhaker.com/2008/04/wordpress-permalinks-lighttpd/">this tutorial</a>, but cache was a no-go: the lighttpd wiki and the wordpress forums had no info, so I had to cook a solution for myself. </p>
	<p>It was easier than I thought though:</p>

<div class="wp_syntax"><div class="code"><pre class="lua" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">-- rewrite.lua, in your WP_ROOT</span>
attr <span style="color: #66cc66;">=</span> lighty.stat<span style="color: #66cc66;">&#40;</span>lighty.env<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;physical.path&quot;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">not</span> attr<span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">then</span>
  lighty.env<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;uri.path&quot;</span><span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">&quot;/index.php&quot;</span>
  lighty.env<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;physical.rel-path&quot;</span><span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">=</span> lighty.env<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;uri.path&quot;</span><span style="color: #66cc66;">&#93;</span>
  lighty.env<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;physical.path&quot;</span><span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">=</span> lighty.env<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;physical.doc-root&quot;</span><span style="color: #66cc66;">&#93;</span> .. lighty.env<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;physical.rel-path&quot;</span><span style="color: #66cc66;">&#93;</span>
&nbsp;
  query_condition <span style="color: #66cc66;">=</span> <span style="color: #b1b100;">not</span> <span style="color: #66cc66;">&#40;</span>lighty.env<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;uri.query&quot;</span><span style="color: #66cc66;">&#93;</span> <span style="color: #b1b100;">and</span> <span style="color: #b1b100;">string.find</span><span style="color: #66cc66;">&#40;</span>lighty.env<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;uri.query&quot;</span><span style="color: #66cc66;">&#93;</span>, <span style="color: #ff0000;">&quot;.*s=.*&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
  user_cookie <span style="color: #66cc66;">=</span> lighty.request<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;Cookie&quot;</span><span style="color: #66cc66;">&#93;</span> <span style="color: #b1b100;">or</span> <span style="color: #ff0000;">&quot;no_cookie_here&quot;</span>
  cookie_condition <span style="color: #66cc66;">=</span> <span style="color: #b1b100;">not</span> <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">string.find</span><span style="color: #66cc66;">&#40;</span>user_cookie, <span style="color: #ff0000;">&quot;.*comment_author.*&quot;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">or</span> <span style="color: #b1b100;">string.find</span><span style="color: #66cc66;">&#40;</span>user_cookie, <span style="color: #ff0000;">&quot;.*wordpress.*&quot;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">or</span> <span style="color: #b1b100;">string.find</span><span style="color: #66cc66;">&#40;</span>user_cookie, <span style="color: #ff0000;">&quot;.*wp-postpass_.*&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>query_condition <span style="color: #b1b100;">and</span> cookie_condition<span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">then</span>
    accept_encoding <span style="color: #66cc66;">=</span> lighty.request<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;Accept-Encoding&quot;</span><span style="color: #66cc66;">&#93;</span> <span style="color: #b1b100;">or</span> <span style="color: #ff0000;">&quot;no_acceptance&quot;</span>
    cached_page <span style="color: #66cc66;">=</span> lighty.env<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;physical.doc-root&quot;</span><span style="color: #66cc66;">&#93;</span> .. <span style="color: #ff0000;">&quot;/wp-content/cache/supercache/&quot;</span> .. lighty.request<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;Host&quot;</span><span style="color: #66cc66;">&#93;</span> .. lighty.env<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;request.uri&quot;</span><span style="color: #66cc66;">&#93;</span> .. <span style="color: #ff0000;">&quot;/index.html&quot;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">string.find</span><span style="color: #66cc66;">&#40;</span>accept_encoding, <span style="color: #ff0000;">&quot;gzip&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">then</span>
      <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>lighty.stat<span style="color: #66cc66;">&#40;</span>cached_page .. <span style="color: #ff0000;">&quot;.gz&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">then</span>
        lighty.header<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;Content-Encoding&quot;</span><span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">&quot;gzip&quot;</span>
        lighty.header<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;Content-Type&quot;</span><span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">&quot;&quot;</span>
        lighty.env<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;physical.path&quot;</span><span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">=</span> cached_page
      <span style="color: #b1b100;">end</span>
    <span style="color: #b1b100;">else</span>
      <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>lighty.stat<span style="color: #66cc66;">&#40;</span>cached_page<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">then</span>
        lighty.env<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;physical.path&quot;</span><span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">=</span> cached_page
      <span style="color: #b1b100;">end</span>
    <span style="color: #b1b100;">end</span>
  <span style="color: #b1b100;">end</span>
<span style="color: #b1b100;">end</span></pre></div></div>

	<p>This rewrite.lua will serve compressed cached pages to those who accept gzip and plain html to those who prefer not to get gzip, while retaining the nice permalinks.</p>


 ]]></content:encoded>
			<wfw:commentRss>http://tempe.st/2008/04/lighttpd-and-wp-supercache-now-you-can/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Tempe.st is dead, long live Tempe.st</title>
		<link>http://tempe.st/2007/05/tempest-is-dead-long-live-tempest/</link>
		<comments>http://tempe.st/2007/05/tempest-is-dead-long-live-tempest/#comments</comments>
		<pubDate>Sat, 12 May 2007 23:44:46 +0000</pubDate>
		<dc:creator>Giovanni Intini</dc:creator>
				<category><![CDATA[Tempe.st]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://tempe.st/2007/05/tempest-is-dead-long-live-tempest/</guid>
		<description><![CDATA[Tempe.st is back online, for your reading pleasure. Site5 had a hard drive failure and their tech support had to restore from backups. While restoring they upgraded PHP and tempe.st stopped working because the Textile2 plugin segfaulted. I upgraded Textile2 to the newest version but it still segfaulted, so I had to enable PHP5. Now [...]]]></description>
			<content:encoded><![CDATA[	<p>Tempe.st is back online, for your reading pleasure. <a href="http://www.site5.com">Site5</a> had a hard drive failure and their tech support had to restore from backups. While restoring they upgraded PHP and tempe.st stopped working because the Textile2 plugin segfaulted. I upgraded Textile2 to the newest version but it still segfaulted, so I had to enable PHP5.</p>
	<p>Now it was wp-vimcolor that didn&#8217;t want to work. After investigating a bit, with the help of the tech support team I discovered a perl module was missing, and now I am finally back.</p>
	<p>Little saturday night adventures <img src='http://tempe.st/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>

 ]]></content:encoded>
			<wfw:commentRss>http://tempe.st/2007/05/tempest-is-dead-long-live-tempest/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Back on the twitter-wagon</title>
		<link>http://tempe.st/2007/04/back-on-the-twitter-wagon/</link>
		<comments>http://tempe.st/2007/04/back-on-the-twitter-wagon/#comments</comments>
		<pubDate>Mon, 02 Apr 2007 10:23:07 +0000</pubDate>
		<dc:creator>Giovanni Intini</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://tempe.st/2007/04/back-on-the-twitter-wagon/</guid>
		<description><![CDATA[A big lot of thanks to Fullo for suggesting me to try twitter-tools to solve the performance related problems I had with twitter. The plugin is wonderfully written and I customized it just a bit, to fit better with the layout. Now I have another problem, to keep the twitter updates as real-time as possible [...]]]></description>
			<content:encoded><![CDATA[	<p>A big lot of thanks to <a href="http://fullo.net">Fullo</a> for suggesting me to try <a href="http://alexking.org/projects/wordpress/readme?project=twitter-tools">twitter-tools</a> to solve the performance related problems I had with twitter.</p>
	<p>The plugin is wonderfully written and I customized it just a bit, to fit better with the layout. Now I have another problem, to keep the twitter updates as real-time as possible I had to disable wp-cache, the cache plugin I use on tempe.st, because it doesn&#8217;t think that a sidebar update is worth a page refresh.</p>
	<p>Anyone can suggest a better cache implementation for wordpress?</p>

 ]]></content:encoded>
			<wfw:commentRss>http://tempe.st/2007/04/back-on-the-twitter-wagon/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Flickr and Yahoo and WordPress</title>
		<link>http://tempe.st/2007/03/flickr-and-yahoo-and-wordpress/</link>
		<comments>http://tempe.st/2007/03/flickr-and-yahoo-and-wordpress/#comments</comments>
		<pubDate>Fri, 30 Mar 2007 23:19:54 +0000</pubDate>
		<dc:creator>Giovanni Intini</dc:creator>
				<category><![CDATA[Flick]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Yahoo]]></category>

		<guid isPermaLink="false">http://tempe.st/2007/03/flickr-and-yahoo-and-wordpress/</guid>
		<description><![CDATA[Today I met a bunch of cool people at the Yahoo Italy HQ. I will talk about that in a future post (the very next one), but I had a urge to try Flickr and its integration with wordpress. Let&#8217;s see if it works by showing you a picture of my last day in Kyoto [...]]]></description>
			<content:encoded><![CDATA[	<p>Today I met a bunch of cool people at the Yahoo Italy HQ. I will talk about that in a future post (the very next one), but I had a urge to try Flickr and its integration with wordpress. Let&#8217;s see if it works by showing you a picture of my last day in Kyoto in Oct. 2006.</p>
	<p><a href="http://www.flickr.com/photos/31887214@N00/440183680/" class="tt-flickr"><img src="http://farm1.static.flickr.com/156/440183680_a6f824375e_t.jpg" alt="Me buying something to eat in Kyoto Station" width="100" height="75" border="0" /></a> </p>

 ]]></content:encoded>
			<wfw:commentRss>http://tempe.st/2007/03/flickr-and-yahoo-and-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Syntax highlighting in WordPress</title>
		<link>http://tempe.st/2007/03/syntax-highlighting-in-wordpress/</link>
		<comments>http://tempe.st/2007/03/syntax-highlighting-in-wordpress/#comments</comments>
		<pubDate>Sat, 17 Mar 2007 20:50:45 +0000</pubDate>
		<dc:creator>Giovanni Intini</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://tempe.st/2007/03/syntax-highlighting-in-wordpress/</guid>
		<description><![CDATA[Syntax highlighting in most CMS/Blog Engines is a straightforward business, you install a plugin and boom your code snippets get highlighted. Simple, right? Right, unless you want to publish erlang snippet The plugin I was using was based on PHP-Geshi, a popular syntax highlighting library that unfortunately doesn&#8217;t support erlang. Looking through the wordpress plugin [...]]]></description>
			<content:encoded><![CDATA[	<p>Syntax highlighting in most CMS/Blog Engines is a straightforward business, you install a plugin <a href="http://youtube.com/watch?v=r8L39UwOS-Y">and boom</a> your code snippets get highlighted. Simple, right? Right, unless you want to publish erlang snippet <img src='http://tempe.st/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
	<p>The plugin I was using was based on PHP-Geshi, a popular syntax highlighting library that unfortunately doesn&#8217;t support erlang. Looking through the wordpress plugin repository I found a little gem: <a href="http://dev.wp-plugins.org/wiki/vimcolor">WP-VimColor</a>, based on VimColor, a perl module that uses the Vim syntax highlighting engine. </p>
	<p>Good old Vim supports more than 200 languages, and obviously it supports erlang, unfortunately the plugin didn&#8217;t want to work with my wordpress installation.</p>
	<p>Instead of nice cleanly formatted code I got some gibberish followed by unformatted code and then some gibberish again. I looked into the code and couldn&#8217;t find what the problem was, then I remembered I had the same problems with <a href="http://radiantcms.com">Radiant CMS</a>, that used textile. I use textile on this blog too and deactivating the textile filter solved the gibberish problem, but gave me lots of php errors related to the file functions.</p>
	<p>Some more tests revealed the source of this problem:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$in_file</span> <span style="color: #339933;">=</span> <span style="color: #990000;">tempnam</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$GLOBALS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'conf'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'file_directory_temp'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'pl'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$out_file</span> <span style="color: #339933;">=</span> <span style="color: #990000;">tempnam</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$GLOBALS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'conf'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'file_directory_temp'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'htm'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

	<p>The two global variables do not exist, so I just replaced them with &#8221;/tmp&#8221; and this problem was fixed. I still had the textile conflict problem, to fix it I changed the last two lines of the plugin file to:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'the_content'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'pre_proccess'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'the_content'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'vim_color'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

	<p>and the if block inside _vimcolor_process_color()_ to</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$multiline</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$html</span> <span style="color: #339933;">=</span> <span style="color: #990000;">preg_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/\r/s'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span><span style="color: #000088;">$html</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$html</span> <span style="color: #339933;">=</span> <span style="color: #990000;">preg_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/\n/s'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'&lt;br /&gt;'</span><span style="color: #339933;">,</span><span style="color: #000088;">$html</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$html</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'==&lt;pre class=&quot;codeblock&quot;&gt;'</span><span style="color: #339933;">.</span> <span style="color: #000088;">$html</span> <span style="color: #339933;">.</span><span style="color: #0000ff;">'</span></pre></div></div>

	<p>';
  $html &#61; preg&#95;replace('/  /s','&amp;nbsp; ',$html);<br />
}else{
  $html &#61; '<pre>'. trim($html) .'</pre>==&#8217;;<br />
}<br />
</pre></p>
	<p>These two fixes make the syntax highlighting filter run before textile and use the &#8221;==&#8221; modifier to tell textile not to fiddle with the code.</p>
	<p>Now I have beatifully formatted code on my blog and I can also publish erlang snippets, <a href="http://youtube.com/watch?v=yw5XzWYfiWU">nice!</a>.</p>
	<p>Or, as my friend Bard would say:</p>

<div class="wp_syntax"><div class="code"><pre class="erlang" style="font-family:monospace;"><span style="color: #109ab8;">&#123;</span>bard<span style="color: #6bb810;">,</span> comment<span style="color: #6bb810;">,</span> <span style="color: #45b3e6;">Value</span><span style="color: #109ab8;">&#125;</span> <span style="color: #014ea4;">=</span> <span style="color: #109ab8;">&#123;</span>bard<span style="color: #6bb810;">,</span> comment<span style="color: #6bb810;">,</span> nice<span style="color: #109ab8;">&#125;</span><span style="color: #6bb810;">.</span></pre></div></div>



 ]]></content:encoded>
			<wfw:commentRss>http://tempe.st/2007/03/syntax-highlighting-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
