<?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>Mohanjith&#039;s Blog &#187; memcached</title> <atom:link href="http://mohanjith.net/blog/topics/memcached/feed" rel="self" type="application/rss+xml" /><link>http://mohanjith.net/blog</link> <description>MOHA blogging news and thoughts...</description> <lastBuildDate>Wed, 14 Dec 2011 14:18:18 +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>WordPress object cache with memcached backend for vanilla WordPress</title><link>http://mohanjith.net/blog/2009/03/wordpress-object-cache-with-memcached-backend-for-vanilla-wordpress.html</link> <comments>http://mohanjith.net/blog/2009/03/wordpress-object-cache-with-memcached-backend-for-vanilla-wordpress.html#comments</comments> <pubDate>Thu, 12 Mar 2009 14:08:09 +0000</pubDate> <dc:creator>S H Mohanjith</dc:creator> <category><![CDATA[memcached]]></category> <category><![CDATA[patch]]></category> <category><![CDATA[WordPress]]></category><guid
isPermaLink="false">http://mohanjith.net/blog/?p=233</guid> <description><![CDATA[TweetWordPress object cache with memcached backend is mainly meant for WPMU and doesn&#8217;t work well if you happened to have many vanilla WordPress installations using the same memcached backend like it is pointed out here and here. I have created a simple patch which you can apply against object-cache.php (downloadable from WordPress plugin repository) or [...]]]></description> <content:encoded><![CDATA[<p><span
style="float: right; margin: 5px 0px 0px 5px;" ><a
class="twitter-share-button"  data-via="mohanjith" data-count="vertical" data-related="" data-lang="en" data-url="http://mohanjith.net/blog/2009/03/wordpress-object-cache-with-memcached-backend-for-vanilla-wordpress.html" data-text="WordPress object cache with memcached backend for vanilla WordPress" href="http://twitter.com/share?via=mohanjith&#038;count=vertical&#038;related=&#038;lang=en&#038;url=http%3A%2F%2Fmohanjith.net%2Fblog%2F2009%2F03%2Fwordpress-object-cache-with-memcached-backend-for-vanilla-wordpress.html&#038;text=WordPress%20object%20cache%20with%20memcached%20backend%20for%20vanilla%20WordPress" >Tweet</a></span>WordPress object cache with memcached backend is mainly meant for WPMU and doesn&#8217;t work well if you happened to have many vanilla WordPress installations using the same memcached backend like it is pointed out <a
href="http://mohanjith.net/blog/2008/10/using-memcached-with-wordpress-object-cache.html">here</a> and <a
href="http://wordpress.org/support/topic/241314?replies=1" target="_blank">here</a>.</p><p>I have created a <a
href="http://cdn.mohanjith.net/blog/wp-content/uploads/2009/03/object-cachephp.patch" target="_blank">simple patch</a> which you can apply against <a
href="http://plugins.trac.wordpress.org/export/71058/memcached/trunk/object-cache.php" target="_blank">object-cache.php</a> (downloadable from WordPress plugin repository) or <a
href="http://cdn.mohanjith.net/blog/wp-content/uploads/2009/03/object-cachephp.txt" target="_blank">here is the file already patched</a>. The patch prepends the <code>$blog_id</code> to the object key. You will have to specify global variable <code>$blog_id</code> in <code>wp-config.php</code> and give it a unique id (like your blog url).</p><pre class="brush: php; ">
global $blog_id;
$blog_id = &#039;mohanjith_net&#039;;
</pre><div
id="fb-like" style=""><iframe
src="http://www.facebook.com/plugins/like.php?href=http://mohanjith.net/blog/2009/03/wordpress-object-cache-with-memcached-backend-for-vanilla-wordpress.html&amp;layout=standard&amp;show_faces=true&amp;width=300&amp;action=like&amp;font=&amp;colorscheme=light&amp;locale=en_US" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:300px; height:30px"></iframe></div>]]></content:encoded> <wfw:commentRss>http://mohanjith.net/blog/2009/03/wordpress-object-cache-with-memcached-backend-for-vanilla-wordpress.html/feed</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>Using memcached with WordPress object cache</title><link>http://mohanjith.net/blog/2008/10/using-memcached-with-wordpress-object-cache.html</link> <comments>http://mohanjith.net/blog/2008/10/using-memcached-with-wordpress-object-cache.html#comments</comments> <pubDate>Wed, 29 Oct 2008 13:03:57 +0000</pubDate> <dc:creator>S H Mohanjith</dc:creator> <category><![CDATA[memcached]]></category> <category><![CDATA[WordPress]]></category><guid
isPermaLink="false">http://mohanjith.net/blog/?p=105</guid> <description><![CDATA[TweetI like the web pages to be snappy, including my blog. I found my blog to be bit slow after I moved to WordPress even after performance tuning. After looking around for a solution I came across memcache back-end for WordPress object cache which can be downloaded from here. You have to drop the file [...]]]></description> <content:encoded><![CDATA[<p><span
style="float: right; margin: 5px 0px 0px 5px;" ><a
class="twitter-share-button"  data-via="mohanjith" data-count="vertical" data-related="" data-lang="en" data-url="http://mohanjith.net/blog/2008/10/using-memcached-with-wordpress-object-cache.html" data-text="Using memcached with WordPress object cache" href="http://twitter.com/share?via=mohanjith&#038;count=vertical&#038;related=&#038;lang=en&#038;url=http%3A%2F%2Fmohanjith.net%2Fblog%2F2008%2F10%2Fusing-memcached-with-wordpress-object-cache.html&#038;text=Using%20memcached%20with%20WordPress%20object%20cache" >Tweet</a></span>I like the web pages to be snappy, including my blog. I found my blog to be bit slow after I moved to WordPress even after <a
href="http://www.arnebrachhold.de/2007/02/16/four-plus-one-ways-to-speed-up-the-performance-of-wordpress-with-caching/" target="_blank">performance tuning</a>. After looking around for a solution I came across memcache back-end for WordPress object cache which can be downloaded from <a
href="http://plugins.trac.wordpress.org/export/71058/memcached/trunk/object-cache.php" target="_blank">here</a>. You have to drop the file object-cache.php into wp-content/. You will have to specify the memcached servers by adding the following lines to wp-config.php.</p><pre class="brush: php; ">
global $memcached_servers;
$memcached_servers = array(&#039;default&#039; =&gt; array(&#039;127.0.0.1:11211&#039;));
</pre><p>My blog loaded faster than before, it was all good. Afterwards I wanted to install the memcache back-end for WP object cache on my <a
href="http://priyani.mohanjith.net/" target="_self">mother&#8217;s blog</a> using the same memcached server. I just dropped the wp-config.php file into my mother&#8217;s installation of WordPress. That&#8217;s when things became awry. My mother&#8217;s blog started to redirect to my blog <img
src='http://cdn.mohanjith.net/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> . After looking at wp-config.php closely it was clear to me it was designed for WordPress MU. However I didn&#8217;t want to give up on using memcache with WordPress. Looking even closer I noticed that I can specify the global variable <code>$blog_id</code> and it would be perpended to the memcache object key. I added the following line to wp-config.php in my mother&#8217;s WordPress installation in addition to the two lines above and applied <a
href="http://cdn.mohanjith.net/blog/wp-content/uploads/2009/03/object-cachephp.patch" target="_blank">this patch</a> (patched <a
href="http://mymg.info/mohanjith.net/blog/wp-content/uploads/2009/03/object-cachephp.txt">object-cache.php</a>).</p><pre class="brush: php; ">
global $blog_id;
$blog_id = &#039;priyani_mohanjith_net&#039;;
</pre><p>That&#8217;s it, both my blog and my mother&#8217;s blog became fast and it was working without any issues. Hope this helps someone who wants to use the same memcached server with multiple installtions of vanilla WordPress. You cannot use this technique or memcache unless your blog is self hosted on a server where you have full control.</p><div
id="fb-like" style=""><iframe
src="http://www.facebook.com/plugins/like.php?href=http://mohanjith.net/blog/2008/10/using-memcached-with-wordpress-object-cache.html&amp;layout=standard&amp;show_faces=true&amp;width=300&amp;action=like&amp;font=&amp;colorscheme=light&amp;locale=en_US" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:300px; height:30px"></iframe></div>]]></content:encoded> <wfw:commentRss>http://mohanjith.net/blog/2008/10/using-memcached-with-wordpress-object-cache.html/feed</wfw:commentRss> <slash:comments>30</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: basic (User agent is rejected)
Database Caching 16/19 queries in 0.012 seconds using memcached
Object Caching 0/0 objects using memcached
Content Delivery Network via cdn.mohanjith.net

Served from: mohanjith.net @ 2012-05-30 08:44:06 -->
