<?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>Nathaniel Engelsen &#187; cache</title>
	<atom:link href="http://nathanielengelsen.com/tag/cache/feed/" rel="self" type="application/rss+xml" />
	<link>http://nathanielengelsen.com</link>
	<description></description>
	<lastBuildDate>Thu, 03 Dec 2009 13:03:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Keeping dynamic header images with WP Super Cache</title>
		<link>http://nathanielengelsen.com/2009/06/keeping-dynamic-header-images-with-wp-super-cache/</link>
		<comments>http://nathanielengelsen.com/2009/06/keeping-dynamic-header-images-with-wp-super-cache/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 17:12:58 +0000</pubDate>
		<dc:creator>nathaniel engelsen</dc:creator>
				<category><![CDATA[meta]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[dynamic]]></category>
		<category><![CDATA[images]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wp_super_cache]]></category>

		<guid isPermaLink="false">http://nathanielengelsen.com/?p=99</guid>
		<description><![CDATA[Enabled caching with WP Super Cache, but kept the dynamic header image.]]></description>
			<content:encoded><![CDATA[<p>The WP Super Cache plugin comes highly recommended, especially with the theme that I&#8217;m using for my blog layout.   I specifically chose this layout with the intention of caching (because of its high load times), but wanted to keep the dynamic header image.</p>
<p>There are many ways of going about doing the random image selection.  I am retrieving an image based on the images stored in a particular directory.  I used this regex:</p>
<p><code><span style="color: #000000;"><span style="color: #007700;">if ( </span><span style="color: #0000bb;">preg_match</span><span style="color: #007700;">(</span><span style="color: #dd0000;">"/(\.gif|\.jpg|\.png)$/"</span><span style="color: #007700;">, </span><span style="color: #0000bb;">$img_file</span><span style="color: #007700;">) ) {<br />
</span><span style="color: #0000bb;">$images</span><span style="color: #007700;">[] = </span><span style="color: #0000bb;">$img_file</span><span style="color: #007700;">;<br />
} </span></span></code></p>
<p>to retrieve my images, and</p>
<p><span style="color: #0000bb;">$image = file_get_contents($root . $path . &#8220;/&#8221; . $img);</span></p>
<p>to retrieve the actual image.  Now WP Super Cache can still serve up a cached page with <a href="http://nathanielengelsen.com/headerimage.php">http://nathanielengelsen.com/headerimage.php</a> always set as the default header image, but headerimage.php can serve up a random dynamic image with every call.</p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fnathanielengelsen.com%2F2009%2F06%2Fkeeping-dynamic-header-images-with-wp-super-cache%2F&amp;partner=sociable" title="Print"><img src="http://nathanielengelsen.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fnathanielengelsen.com%2F2009%2F06%2Fkeeping-dynamic-header-images-with-wp-super-cache%2F&amp;title=Keeping%20dynamic%20header%20images%20with%20WP%20Super%20Cache&amp;bodytext=Enabled%20caching%20with%20WP%20Super%20Cache%2C%20but%20kept%20the%20dynamic%20header%20image." title="Digg"><img src="http://nathanielengelsen.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fnathanielengelsen.com%2F2009%2F06%2Fkeeping-dynamic-header-images-with-wp-super-cache%2F&amp;title=Keeping%20dynamic%20header%20images%20with%20WP%20Super%20Cache&amp;notes=Enabled%20caching%20with%20WP%20Super%20Cache%2C%20but%20kept%20the%20dynamic%20header%20image." title="del.icio.us"><img src="http://nathanielengelsen.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fnathanielengelsen.com%2F2009%2F06%2Fkeeping-dynamic-header-images-with-wp-super-cache%2F&amp;t=Keeping%20dynamic%20header%20images%20with%20WP%20Super%20Cache" title="Facebook"><img src="http://nathanielengelsen.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fnathanielengelsen.com%2F2009%2F06%2Fkeeping-dynamic-header-images-with-wp-super-cache%2F&amp;title=Keeping%20dynamic%20header%20images%20with%20WP%20Super%20Cache&amp;annotation=Enabled%20caching%20with%20WP%20Super%20Cache%2C%20but%20kept%20the%20dynamic%20header%20image." title="Google Bookmarks"><img src="http://nathanielengelsen.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.dotnetkicks.com/kick/?url=http%3A%2F%2Fnathanielengelsen.com%2F2009%2F06%2Fkeeping-dynamic-header-images-with-wp-super-cache%2F&amp;title=Keeping%20dynamic%20header%20images%20with%20WP%20Super%20Cache" title="DotNetKicks"><img src="http://nathanielengelsen.com/wp-content/plugins/sociable/images/dotnetkicks.png" title="DotNetKicks" alt="DotNetKicks" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://news.ycombinator.com/submitlink?u=http%3A%2F%2Fnathanielengelsen.com%2F2009%2F06%2Fkeeping-dynamic-header-images-with-wp-super-cache%2F&amp;t=Keeping%20dynamic%20header%20images%20with%20WP%20Super%20Cache" title="HackerNews"><img src="http://nathanielengelsen.com/wp-content/plugins/sociable/images/hackernews.png" title="HackerNews" alt="HackerNews" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fnathanielengelsen.com%2F2009%2F06%2Fkeeping-dynamic-header-images-with-wp-super-cache%2F&amp;title=Keeping%20dynamic%20header%20images%20with%20WP%20Super%20Cache&amp;source=Nathaniel+Engelsen+&amp;summary=Enabled%20caching%20with%20WP%20Super%20Cache%2C%20but%20kept%20the%20dynamic%20header%20image." title="LinkedIn"><img src="http://nathanielengelsen.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fnathanielengelsen.com%2F2009%2F06%2Fkeeping-dynamic-header-images-with-wp-super-cache%2F&amp;title=Keeping%20dynamic%20header%20images%20with%20WP%20Super%20Cache" title="Reddit"><img src="http://nathanielengelsen.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  target="_blank" href="http://slashdot.org/bookmark.pl?title=Keeping%20dynamic%20header%20images%20with%20WP%20Super%20Cache&amp;url=http%3A%2F%2Fnathanielengelsen.com%2F2009%2F06%2Fkeeping-dynamic-header-images-with-wp-super-cache%2F" title="Slashdot"><img src="http://nathanielengelsen.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://nathanielengelsen.com/2009/06/keeping-dynamic-header-images-with-wp-super-cache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

