<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"><channel><title>benjamingolub.com - Latest Comments in Google App Engine + Memcached + FF To Go = Bliss</title><link>http://benjamingolub.disqus.com/</link><description></description><language>en</language><lastBuildDate>Wed, 28 May 2008 20:40:17 -0000</lastBuildDate><item><title>Re: Google App Engine + Memcached + FF To Go = Bliss</title><link>http://benjamingolub.com/2008/05/28/google-app-engine-memcached-ff-to-go-bliss/#comment-545907</link><description>Ahh I see--foot, meet mouth :)  Still, it's cool stuff.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">ericflo</dc:creator><pubDate>Wed, 28 May 2008 20:40:17 -0000</pubDate></item><item><title>Re: Google App Engine + Memcached + FF To Go = Bliss</title><link>http://benjamingolub.com/2008/05/28/google-app-engine-memcached-ff-to-go-bliss/#comment-545890</link><description>It's a little trickier than that; because the user can also set the font size and the header contains a link to the user's friendfeed page.  But yes; this is exactly what I do on RSSmeme (and as I'm sure you are aware it's how the Django cache middleware works).  I cache the entire response (I also cache the results from the DB so hitting the html and then the API for the same data doesn't result in 2 DB requests).  Since this runs on Google App Engine and the CPU is not a bottleneck at all I'm not worried about the time spent on the template system too much.&lt;br&gt;&lt;br&gt;But thanks!</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">bgolub</dc:creator><pubDate>Wed, 28 May 2008 20:36:51 -0000</pubDate></item><item><title>Re: Google App Engine + Memcached + FF To Go = Bliss</title><link>http://benjamingolub.com/2008/05/28/google-app-engine-memcached-ff-to-go-bliss/#comment-545855</link><description>Sorry, Disqus is not so great for code snippets :(</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">ericflo</dc:creator><pubDate>Wed, 28 May 2008 20:30:40 -0000</pubDate></item><item><title>Re: Google App Engine + Memcached + FF To Go = Bliss</title><link>http://benjamingolub.com/2008/05/28/google-app-engine-memcached-ff-to-go-bliss/#comment-545851</link><description>I think you might be better off caching the entire response, as then subsequent requests don't even have to go through the template system, context processors, etc.&lt;br&gt;&lt;br&gt;For example:&lt;br&gt;&lt;br&gt;...&lt;br&gt;key = 'public_%i_%i_%s' % (num, start, service)&lt;br&gt;response = memcache.get(key)&lt;br&gt;    if not response:&lt;br&gt;        try:&lt;br&gt;            data = f.fetch_public_feed(num=num, start=start, service=service)&lt;br&gt;        except Exception, e:&lt;br&gt;            return HttpResponseRedirect('/%s/' % e)&lt;br&gt;        extra_context = {&lt;br&gt;            'entries': data['entries'],&lt;br&gt;            ‘next’: start + num,&lt;br&gt;        }&lt;br&gt;        if start &amp;gt; 0:&lt;br&gt;            extra_context['has_previous'] = True&lt;br&gt;            extra_context['previous'] = start - num&lt;br&gt;        response = render_to_response(’public.html’, extra_context, context_instance=RequestContext(request))&lt;br&gt;        memcache.set(key, response, CACHE_TIME)&lt;br&gt;    return response</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">ericflo</dc:creator><pubDate>Wed, 28 May 2008 20:30:10 -0000</pubDate></item></channel></rss>