>            page = CachedObject.all(keys_only=True).filter('appversion =', 
> appversion) \
>                                                   .filter('uri =', uri).get()
>            if page:
>                p = db.get(str(page))
>                self.write(p.html)
>                memcache.set(cachekey, p.html, 
> namespace='cachedpage|%s'%appversion)
>                return
>            else:

Why do you first check to see if the datastore object exist
(keys_only=True) and then fetch if key is found. This adds an extra
RPC roundtrip.
Just fetch the object and test page for None

           page = CachedObject.all().filter('appversion =', appversion) \
                                                 .filter('uri =', uri).get()
           if page:
               self.write(p.html)
               memcache.set(cachekey, p.html,
namespace='cachedpage|%s'%appversion)
               return
           else:

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to