<?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>Intrepid Blog &#187; cache</title>
	<atom:link href="http://blog.affien.com/archives/tag/cache/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.affien.com</link>
	<description>A few thoughts</description>
	<lastBuildDate>Mon, 23 Jan 2012 08:47:37 +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>Caching in PHP</title>
		<link>http://blog.affien.com/archives/2005/02/11/caching-in-php/</link>
		<comments>http://blog.affien.com/archives/2005/02/11/caching-in-php/#comments</comments>
		<pubDate>Fri, 11 Feb 2005 16:06:03 +0000</pubDate>
		<dc:creator>Bas Westerbaan</dc:creator>
				<category><![CDATA[Web development]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://blog.w-nz.com/archives/2005/02/11/caching-in-php/</guid>
		<description><![CDATA[It is usefull to cache certain things between Php scrip [...]]]></description>
			<content:encoded><![CDATA[<p>It is usefull to cache certain things between Php script executions.<br />
Some boards written in Php cache the forum architecture so a difficult query hasn&#8217;t got to be run every time a guest views the board.</p>
<p>There are a few ways to cache  data:</p>
<ul>
<li><strong>Php script</strong>. Data will be stored as a normal php file which will be included during execution</li>
<li><strong>Serialized object in file</strong>. Data will be serialized and dumped to a file which will be read every page view</li>
<li><strong>Database storage</strong>. Data will be serialized and stored in a database and queried every page view.</li>
</ul>
<p>There are a lot of myths about using a database would be way slower than a normal php file.</p>
<p>I&#8217;ve run a few tests caching a ~16kB php array, the results:</p>
<p><strong>Serialized object stored in file:</strong> 0.0015ms<br />
<strong>Object in PHP script:</strong> 0.0121ms<br />
<strong>Serialized object stored in mySQL database:</strong> 0.0015ms</p>
<p>It seems to be quicker to use a serialized array in a file as configuration file than a <code>config.php</code> php script!</p>
<p>Databases although just as quick as normal files are favored by me for they are much more scalable.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.affien.com/archives/2005/02/11/caching-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

