<?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>Neural Core Dump &#187; XCache</title>
	<atom:link href="http://www.jeffdarlington.com/tag/xcache/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jeffdarlington.com</link>
	<description>The personal blog of Jeffrey T. Darlington, creator of General Protection Fault</description>
	<lastBuildDate>Sat, 28 Jan 2012 20:00:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Praise for XCache</title>
		<link>http://www.jeffdarlington.com/2008/03/18/praise-for-xcache/</link>
		<comments>http://www.jeffdarlington.com/2008/03/18/praise-for-xcache/#comments</comments>
		<pubDate>Wed, 19 Mar 2008 01:34:12 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[GPF]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[opcode]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[XCache]]></category>

		<guid isPermaLink="false">http://www.jeffdarlington.com/2008/03/18/praise-for-xcache/</guid>
		<description><![CDATA[The new GPF site has been running live for half a month now, and I&#8217;m proud to say things have been running incredibly smoothly. That is, at least, from my perspective; I haven&#8217;t seen any major glitches, and aside from a few typos in the comic (which are obviously independent of the site code), nobody [...]]]></description>
			<content:encoded><![CDATA[<p>The new <a href="http://www.gpf-comics.com/" title="General Protection Fault">GPF</a> site has been running live for half a month now, and I&#8217;m proud to say things have been running incredibly smoothly. That is, at least, from my perspective; I haven&#8217;t <em>seen</em> any major glitches, and aside from a few typos in the comic (which are obviously independent of the site code), nobody has written me about any problems. This is especially heartening because the new site was pretty much entirely coded by hand by me, sans a few bits and pieces. (I can&#8217;t take credit for the OS, the web server software, the database engine, or the forum. But everything else&#8230; yep, that was me.)</p>
<p>There were a lot of motivations for writing my own archiving system, but the primary one was efficiency. While I considered trying something off-the-shelf, so to speak, like <a href="http://mindfaucet.com/comicpress/" title="ComicPress">ComicPress</a> or <a href="http://drupal.org/" title="Drupal">Drupal</a>, I really wanted something that would be blazingly fast yet still dynamically generated to let me do things like <a href="http://www.gpf-comics.com/premium/" title="GPF Premium">GPF Premium</a> on the server side, primarily for security reasons. (Server-side processing means no messy JavaScript is required by the users, thus exposing them to less risks, while Premium content doesn&#8217;t even get sent to the browser at all if Premium isn&#8217;t enabled.) So the GPF site is optimized out the wahzoo, with certain high-volume pages built once by nightly crons while others that require more interactivity reduce database queries to simple selects as much as possible. I&#8217;m never one to brag and toot my own horn, but I&#8217;m actually pretty proud of the new site and how responsive it is.</p>
<p>Of course, I can&#8217;t really take <em>all</em> the credit. I do have to give some serious props to <a href="http://xcache.lighttpd.net/" title="XCache">XCache</a>.</p>
<p>For those unfamiliar with <a href="http://www.php.net/" title="PHP">PHP</a>, it is one of many server-side, interpreted scripting languages commonly used for dynamic Web site development. The caveat, however, to any interpreted language is that on each request the source script must be read, parsed, <a href="http://en.wikipedia.org/wiki/Compiler" title="Compiler article on Wikipedia">compiled</a>, and executed before anything is set back to the end user&#8217;s browser. This is one reason why dynamic sites are and will always be slower than serving purely static HTML files. Static HTML just needs to be read and regurgitated; anything that requires the Web server to actually <em>think</em> takes more time. Add to that the fact that there could be hundreds or even thousands of requests all competing at once for content and it&#8217;s a miracle anything get served at all.</p>
<p>XCache is one of several <a href="http://en.wikipedia.org/wiki/Opcode" title="Opcode article on Wikipedia">opcode</a> <a href="http://en.wikipedia.org/wiki/Cache" title="Cache article on Wikipedia">caching</a> extensions for PHP. Essentially, when the first request for a script is made, the script is parsed and compiled as usual. However, XCache stores the compiled code so subsequent requests can skip the parsing and compilation steps and go directly to executing the code. This significantly increases the speed of execution by eliminating one of the costliest parts of the process (except perhaps database connections). In addition, XCache also includes the ability to cache <a href="http://en.wikipedia.org/wiki/Variable" title="Variable article on Wikipedia">variables</a> and <a href="http://en.wikipedia.org/wiki/Object-oriented_programming" title="Object-oriented programming article on Wikipedia">objects</a>, so commonly repeated and expensive variable generation&#8211;such as the <a href="http://en.wikipedia.org/wiki/Cryptographic_hash_function" title="Cryptographic hash function article on Wikipedia">cryptographic hashes</a> I use for salting cookie hashes or database look-ups for common elements like the Premium subscription levels&#8211;can be stored in the cache rather rebuilt on each request.</p>
<p>I was first introduced to XCache by the <a href="http://neosmart.net/dl.php?id=12" title="NeoSmart Technologies: XCache for WordPress">XCache for WordPress</a> plugin, which was probably mentioned in one of the development feeds built into the <a href="http://wordpress.org/" title="WordPress">WordPress</a> dashboard. I&#8217;ve been running this combination here on the blog for a little while with moderate success; I&#8217;m still trying to find a good balance of configuration settings to get the best results, but I&#8217;ve been happy with the results so far. Without putting much thought into it, I went ahead and installed XCache on the GPF server, hoping that it would help even if I never got a chance to optimize it. Fortunately, it <em>has</em> helped, and now that I&#8217;ve optimized the settings it&#8217;s exceeded most of my expectations. I&#8217;m not sure if there&#8217;s something about my code that caches better than WordPress, but GPF has done much better with XCache than the blog has.</p>
<p>Admittedly, I haven&#8217;t compared it to any other opcode cachers, nor have I benchmarked it against any of the competition. That said, however, I heartily recommend it to anybody running PHP applications. To get the greatest benefit, you may need to modify some code (or install a plugin if you&#8217;re using a prepackaged application) to take advantage of the variable/object caching. But even without modification the opcode caching alone makes for a vast improvement.</p><div><a class="addthis_button" href="//addthis.com/bookmark.php?v=250" addthis:url='http://www.jeffdarlington.com/2008/03/18/praise-for-xcache/' addthis:title='Praise for XCache '><img src="//cache.addthis.com/cachefly/static/btn/v2/lg-share-en.gif" width="125" height="16" alt="Bookmark and Share" style="border:0"/></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.jeffdarlington.com/2008/03/18/praise-for-xcache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

