<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Improving Django Cache &#8211; Part III</title>
	<atom:link href="http://richwklein.com/2009/08/11/improving-django-cache-part-iii/feed/" rel="self" type="application/rss+xml" />
	<link>http://richwklein.com/2009/08/11/improving-django-cache-part-iii/</link>
	<description>A blog about nothing</description>
	<lastBuildDate>Tue, 06 Apr 2010 16:48:33 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Rich</title>
		<link>http://richwklein.com/2009/08/11/improving-django-cache-part-iii/comment-page-1/#comment-10596</link>
		<dc:creator>Rich</dc:creator>
		<pubDate>Thu, 13 Aug 2009 21:06:19 +0000</pubDate>
		<guid isPermaLink="false">http://richwklein.com/?p=670#comment-10596</guid>
		<description>You are beating me to the punch.  My next post in the series is on creating a cache decorator.  :)</description>
		<content:encoded><![CDATA[<p>You are beating me to the punch.  My next post in the series is on creating a cache decorator.  <img src='http://richwklein.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rich</title>
		<link>http://richwklein.com/2009/08/11/improving-django-cache-part-iii/comment-page-1/#comment-11905</link>
		<dc:creator>Rich</dc:creator>
		<pubDate>Thu, 13 Aug 2009 21:06:00 +0000</pubDate>
		<guid isPermaLink="false">http://richwklein.com/?p=670#comment-11905</guid>
		<description>You are beating me to the punch.  My next post in the series is on creating a cache decorator.  :)</description>
		<content:encoded><![CDATA[<p>You are beating me to the punch.  My next post in the series is on creating a cache decorator.  <img src='http://richwklein.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben Bangert</title>
		<link>http://richwklein.com/2009/08/11/improving-django-cache-part-iii/comment-page-1/#comment-10595</link>
		<dc:creator>Ben Bangert</dc:creator>
		<pubDate>Thu, 13 Aug 2009 20:20:08 +0000</pubDate>
		<guid isPermaLink="false">http://richwklein.com/?p=670#comment-10595</guid>
		<description>And here&#039;s that code snippet with formatting:
http://pylonshq.com/pasties/abfff860550a3cb508d5dd817d502070</description>
		<content:encoded><![CDATA[<p>And here&#8217;s that code snippet with formatting:<br />
<a href="http://pylonshq.com/pasties/abfff860550a3cb508d5dd817d502070" rel="nofollow">http://pylonshq.com/pasties/abfff860550a3cb508d5dd817d502070</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben Bangert</title>
		<link>http://richwklein.com/2009/08/11/improving-django-cache-part-iii/comment-page-1/#comment-11904</link>
		<dc:creator>Ben Bangert</dc:creator>
		<pubDate>Thu, 13 Aug 2009 20:20:00 +0000</pubDate>
		<guid isPermaLink="false">http://richwklein.com/?p=670#comment-11904</guid>
		<description>And here&#039;s that code snippet with formatting:
http://pylonshq.com/pasties/abfff860550a3cb508d5dd817d502070</description>
		<content:encoded><![CDATA[<p>And here&#8217;s that code snippet with formatting:<br />
<a href="http://pylonshq.com/pasties/abfff860550a3cb508d5dd817d502070" rel="nofollow">http://pylonshq.com/pasties/abfff860550a3cb508d5dd817d502070</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben Bangert</title>
		<link>http://richwklein.com/2009/08/11/improving-django-cache-part-iii/comment-page-1/#comment-10594</link>
		<dc:creator>Ben Bangert</dc:creator>
		<pubDate>Thu, 13 Aug 2009 20:18:58 +0000</pubDate>
		<guid isPermaLink="false">http://richwklein.com/?p=670#comment-10594</guid>
		<description>Hmm, not sure it&#039;d be ideal to put in there. What would probably work best is to make a Django middleware, that add&#039;s a cache instance to the request object.

That way inside a Django function, you could do something like:

def myview(request):
    @request.cache.cache(&#039;my_search_func&#039;, expire=3600)
    def get_results(search_param):
        # do something to retrieve data
        data = get_data(search_param)
        return data
    results = get_results(&#039;demo&#039;)
    return Response(results)

This way you could use the nice decorator API:
http://beaker.groovie.org/caching.html#decorator-api

You&#039;d also hopefully be able to pass the appropriate beaker configuration options to the middleware then as well, since Beaker supports several different back-ends (even simultaneously), so that you could change which backend is used on a per-cache basis as appropriate.</description>
		<content:encoded><![CDATA[<p>Hmm, not sure it&#8217;d be ideal to put in there. What would probably work best is to make a Django middleware, that add&#8217;s a cache instance to the request object.</p>
<p>That way inside a Django function, you could do something like:</p>
<p>def myview(request):<br />
    @request.cache.cache(&#8216;my_search_func&#8217;, expire=3600)<br />
    def get_results(search_param):<br />
        # do something to retrieve data<br />
        data = get_data(search_param)<br />
        return data<br />
    results = get_results(&#8216;demo&#8217;)<br />
    return Response(results)</p>
<p>This way you could use the nice decorator API:<br />
<a href="http://beaker.groovie.org/caching.html#decorator-api" rel="nofollow">http://beaker.groovie.org/caching.html#decorator-api</a></p>
<p>You&#8217;d also hopefully be able to pass the appropriate beaker configuration options to the middleware then as well, since Beaker supports several different back-ends (even simultaneously), so that you could change which backend is used on a per-cache basis as appropriate.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben Bangert</title>
		<link>http://richwklein.com/2009/08/11/improving-django-cache-part-iii/comment-page-1/#comment-11903</link>
		<dc:creator>Ben Bangert</dc:creator>
		<pubDate>Thu, 13 Aug 2009 20:18:00 +0000</pubDate>
		<guid isPermaLink="false">http://richwklein.com/?p=670#comment-11903</guid>
		<description>Hmm, not sure it&#039;d be ideal to put in there. What would probably work best is to make a Django middleware, that add&#039;s a cache instance to the request object.

That way inside a Django function, you could do something like:

def myview(request):
    @request.cache.cache(&#039;my_search_func&#039;, expire=3600)
    def get_results(search_param):
        # do something to retrieve data
        data = get_data(search_param)
        return data
    results = get_results(&#039;demo&#039;)
    return Response(results)

This way you could use the nice decorator API:
http://beaker.groovie.org/caching.html#decorator-api

You&#039;d also hopefully be able to pass the appropriate beaker configuration options to the middleware then as well, since Beaker supports several different back-ends (even simultaneously), so that you could change which backend is used on a per-cache basis as appropriate.</description>
		<content:encoded><![CDATA[<p>Hmm, not sure it&#8217;d be ideal to put in there. What would probably work best is to make a Django middleware, that add&#8217;s a cache instance to the request object.</p>
<p>That way inside a Django function, you could do something like:</p>
<p>def myview(request):<br />
    @request.cache.cache(&#8216;my_search_func&#8217;, expire=3600)<br />
    def get_results(search_param):<br />
        # do something to retrieve data<br />
        data = get_data(search_param)<br />
        return data<br />
    results = get_results(&#8216;demo&#8217;)<br />
    return Response(results)</p>
<p>This way you could use the nice decorator API:<br />
<a href="http://beaker.groovie.org/caching.html#decorator-api" rel="nofollow">http://beaker.groovie.org/caching.html#decorator-api</a></p>
<p>You&#8217;d also hopefully be able to pass the appropriate beaker configuration options to the middleware then as well, since Beaker supports several different back-ends (even simultaneously), so that you could change which backend is used on a per-cache basis as appropriate.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rich</title>
		<link>http://richwklein.com/2009/08/11/improving-django-cache-part-iii/comment-page-1/#comment-10591</link>
		<dc:creator>Rich</dc:creator>
		<pubDate>Thu, 13 Aug 2009 18:46:32 +0000</pubDate>
		<guid isPermaLink="false">http://richwklein.com/?p=670#comment-10591</guid>
		<description>I&#039;m just taking a looking at your source code.  Pretty nice, it would be interesting if you could add a wrapper so it could be used as a custom Django cache backend.

http://docs.djangoproject.com/en/dev/topics/cache/</description>
		<content:encoded><![CDATA[<p>I&#8217;m just taking a looking at your source code.  Pretty nice, it would be interesting if you could add a wrapper so it could be used as a custom Django cache backend.</p>
<p><a href="http://docs.djangoproject.com/en/dev/topics/cache/" rel="nofollow">http://docs.djangoproject.com/en/dev/topics/cache/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rich</title>
		<link>http://richwklein.com/2009/08/11/improving-django-cache-part-iii/comment-page-1/#comment-11902</link>
		<dc:creator>Rich</dc:creator>
		<pubDate>Thu, 13 Aug 2009 18:46:00 +0000</pubDate>
		<guid isPermaLink="false">http://richwklein.com/?p=670#comment-11902</guid>
		<description>I&#039;m just taking a looking at your source code.  Pretty nice, it would be interesting if you could add a wrapper so it could be used as a custom Django cache backend.

http://docs.djangoproject.com/en/dev/topics/cache/</description>
		<content:encoded><![CDATA[<p>I&#8217;m just taking a looking at your source code.  Pretty nice, it would be interesting if you could add a wrapper so it could be used as a custom Django cache backend.</p>
<p><a href="http://docs.djangoproject.com/en/dev/topics/cache/" rel="nofollow">http://docs.djangoproject.com/en/dev/topics/cache/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben Bangert</title>
		<link>http://richwklein.com/2009/08/11/improving-django-cache-part-iii/comment-page-1/#comment-10590</link>
		<dc:creator>Ben Bangert</dc:creator>
		<pubDate>Thu, 13 Aug 2009 18:31:16 +0000</pubDate>
		<guid isPermaLink="false">http://richwklein.com/?p=670#comment-10590</guid>
		<description>Or you could just setup and use Beaker&#039;s caching system in Django:
http://beaker.groovie.org/

Fast, performs great, oh, and it actually prevents the dog-pile effect which kills most of the hodge-podge caching stuff. It also handles the messy locking to prevent multiple processes on the same machine from all re-creating the cached value at once, and its been used in large production systems for quite a long while now.

I&#039;d be happy to include some stuff to make it easier to use from Django if someone cares to submit some patches. :)</description>
		<content:encoded><![CDATA[<p>Or you could just setup and use Beaker&#8217;s caching system in Django:<br />
<a href="http://beaker.groovie.org/" rel="nofollow">http://beaker.groovie.org/</a></p>
<p>Fast, performs great, oh, and it actually prevents the dog-pile effect which kills most of the hodge-podge caching stuff. It also handles the messy locking to prevent multiple processes on the same machine from all re-creating the cached value at once, and its been used in large production systems for quite a long while now.</p>
<p>I&#8217;d be happy to include some stuff to make it easier to use from Django if someone cares to submit some patches. <img src='http://richwklein.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben Bangert</title>
		<link>http://richwklein.com/2009/08/11/improving-django-cache-part-iii/comment-page-1/#comment-11901</link>
		<dc:creator>Ben Bangert</dc:creator>
		<pubDate>Thu, 13 Aug 2009 18:31:00 +0000</pubDate>
		<guid isPermaLink="false">http://richwklein.com/?p=670#comment-11901</guid>
		<description>Or you could just setup and use Beaker&#039;s caching system in Django:
http://beaker.groovie.org/

Fast, performs great, oh, and it actually prevents the dog-pile effect which kills most of the hodge-podge caching stuff. It also handles the messy locking to prevent multiple processes on the same machine from all re-creating the cached value at once, and its been used in large production systems for quite a long while now.

I&#039;d be happy to include some stuff to make it easier to use from Django if someone cares to submit some patches. :)</description>
		<content:encoded><![CDATA[<p>Or you could just setup and use Beaker&#8217;s caching system in Django:<br />
<a href="http://beaker.groovie.org/" rel="nofollow">http://beaker.groovie.org/</a></p>
<p>Fast, performs great, oh, and it actually prevents the dog-pile effect which kills most of the hodge-podge caching stuff. It also handles the messy locking to prevent multiple processes on the same machine from all re-creating the cached value at once, and its been used in large production systems for quite a long while now.</p>
<p>I&#8217;d be happy to include some stuff to make it easier to use from Django if someone cares to submit some patches. <img src='http://richwklein.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.290 seconds -->
