<?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>Aldoblog &#187; staticize</title>
	<atom:link href="http://aldoblog.com/tag/staticize/feed/" rel="self" type="application/rss+xml" />
	<link>http://aldoblog.com</link>
	<description>Michael Alderete’s Weblog</description>
	<lastBuildDate>Wed, 23 May 2012 11:14:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Problem with caching plug-in</title>
		<link>http://aldoblog.com/2005/01/problem-with-caching-plug-in/</link>
		<comments>http://aldoblog.com/2005/01/problem-with-caching-plug-in/#comments</comments>
		<pubDate>Mon, 10 Jan 2005 19:05:37 +0000</pubDate>
		<dc:creator>Alderete</dc:creator>
				<category><![CDATA[About This Site]]></category>
		<category><![CDATA[caching]]></category>
		<category><![CDATA[staticize]]></category>
		<category><![CDATA[time-since]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://aldoblog.com/blog/421</guid>
		<description><![CDATA[I've run into a slight problem with the Staticize caching plug-in I was using to speed up WordPress on this site. It seems that $post->post_date isn't correctly calculated on cached entries, even when you put them "outside" the cached page, and this screws up the time display on individual entries.]]></description>
			<content:encoded><![CDATA[<p></p>	<p>I&#8217;ve run into a slight problem with the <a href="http://photomatt.net/2004/07/26/staticize-25/">Staticize caching plug-in</a> I was using to speed up WordPress on this site. It seems that $post-&gt;post_date isn&#8217;t correctly calculated on cached entries, even when you put them &#8220;outside&#8221; the cached page, and this screws up the time display on individual entries.</p>

	<p><span id="more-421"></span></p>

	<p>Here&#8217;s the details. On my permalinks pages, I display a relative publication time, e.g., &#8220;Posted 3 days 27 minutes ago&#8221;, using the <a href="http://binarybonsai.com/archives/2004/08/17/time-since-plugin/">Dunstan&#8217;s Time Since</a> plug-in from Binary Bonsai. This works fine when the Staticize plug-in is disabled, and it works fine when Staticize is enabled, but only the first time the page is displayed, i.e., when it&#8217;s <em>not</em> served out of the cache. However, upon reloading, the page is served from cache, and the relative time displayed changes to the time since midnight.</p>

	<p>Now, since this relative time will change, minute by minute, it has to be outside the cache, or it won&#8217;t update. Staticize has an easy way to accomplish this using simple tags. In my index.php page for WordPress, to display the relative time I have:</p>

	<p><code>Posted &lt;!--mclude timesince.php--&gt;&lt;?php require(&#39;timesince.php&#39;); ?&gt;&lt;!--/mclude--&gt; ago</code></p>

	<p>The timesince.php file is also pretty simple, just a quick calculation to emit the relative time:</p>

	<p><code>&lt;?php $entry_datetime = abs(strtotime($post-&gt;post_date) - (60*60*8)); 
echo time_since($entry_datetime); ?&gt;</code></p>

	<p>This technique tells the Staticize plug-in to process the include file every time, not just the first time. In theory, this would allow the relative timestamp to be calculated each time the page is served, and thus always be correct.</p>

	<p>But I think that when Staticize is enabled, and determines that a page is in the cache, $post isn&#8217;t fully set for that page, and so the value of $post-&gt;post_date is meaningless, or it actually has no value at all, and so the functions above just calculate from the current date.</p>

	<p>At any rate, for now the site doesn&#8217;t need caching to keep up, so I&#8217;ve turned off Staticize until I can decide if I care more about displaying the time since or about being ready for a traffic spike. <hr />Copyright &copy; 2012 by <strong><a href="http://aldoblog.com">Aldoblog</a></strong>. All rights reserved. This feed is provided for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact legal-2011@aldoblog.com so we can take action immediately.</p>]]></content:encoded>
			<wfw:commentRss>http://aldoblog.com/2005/01/problem-with-caching-plug-in/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Done digging for a while</title>
		<link>http://aldoblog.com/2005/01/done-digging-for-a-while/</link>
		<comments>http://aldoblog.com/2005/01/done-digging-for-a-while/#comments</comments>
		<pubDate>Sun, 09 Jan 2005 03:19:40 +0000</pubDate>
		<dc:creator>Alderete</dc:creator>
				<category><![CDATA[About This Site]]></category>
		<category><![CDATA[Anti-Spam]]></category>
		<category><![CDATA[anti-spam]]></category>
		<category><![CDATA[caching]]></category>
		<category><![CDATA[kubrick]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[spam]]></category>
		<category><![CDATA[staticize]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://aldoblog.com/blog/420</guid>
		<description><![CDATA[I spent a couple of hours yesterday working on a few last lingering details for this site. The main changes I wanted to make were to upgrade to the latest version of WordPress (a minor security update), make sure I was using the latest version of the Kubrick template (I was), and most importantly, fix the problems I was having with the Kubrick comments form.]]></description>
			<content:encoded><![CDATA[<p></p>	<p>I spent a couple of hours yesterday working on a few last lingering details for this site. The main changes I wanted to make were to upgrade to the latest version of WordPress (a <a href="http://wordpress.org/development/2004/12/one-point-two-two/">minor security update</a>), make sure I was using the latest version of the <a href="http://binarybonsai.com/kubrick/">Kubrick template</a> (I was), and most importantly, fix the problems I was having with the Kubrick comments form, which is a lot cleaner and nicer than the standard WordPress version.</p>

	<p><span id="more-420"></span></p>

	<p>It turned out the issue was a couple of the <span class="caps">PHP</span> &#8220;open&#8221; tags &#8212; the text tokens that are used to signal that what follows is <span class="caps">PHP</span> code, not <span class="caps">HTML</span> code. The Kubrick template (at least as of version 1.2.6) uses the standard &#8220;full&#8221; tags almost everywhere, but there were a few instances where the developer used the short versions. Since I have short tags disabled on my server, it was causing a parse error, the end result of which was that the comments form could not be displayed. Fixed.</p>

	<p>Now that I&#8217;ve got comments working, I switched to allowing comments on postings by default, and letting them post without moderation first. We&#8217;ll see how that goes.</p>

	<p>Because, the weblog world is dealing with a plague of comment spam these days, from &#8220;search engine optimization&#8221; scumbags who are trying to promote their (or their clients&#8217;) websites. So I&#8217;ve also installed and enabled a number of comment spam plug-ins. We&#8217;ll see how that goes, too, though I&#8217;m somewhat pessimistic, for <a href="http://diveintomark.org/archives/2003/11/15/more-spam">a slew of reasons</a>. Probably I&#8217;ll have to turn moderation back on at some point&#8230;</p>

	<p>And I installed a new <a href="http://photomatt.net/2004/07/26/staticize-25/">caching plug-in</a>, which should theoretically improve the performance of this site. Not really a problem with the volume of visitors I&#8217;m getting today, but you never know, and having the plug-in active will hopefully prevent unpleasant surprises.<hr />Copyright &copy; 2012 by <strong><a href="http://aldoblog.com">Aldoblog</a></strong>. All rights reserved. This feed is provided for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact legal-2011@aldoblog.com so we can take action immediately.</p>]]></content:encoded>
			<wfw:commentRss>http://aldoblog.com/2005/01/done-digging-for-a-while/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

