How can I create a variable that is scoped to a single request in app engine?
Module variables may (or may not) persist between requests (the same app instance may or may not stay alive between requests), but you can explicitly clear them (del, or set to None, say) at the start of your handling a request, or when you know you're done with one. At worst (if your code is peculiarly organized) you need to set some function to always execute at every request start, or at every request end.
I'm creating a python app for google app engine and I've got a performance problem with some expensive operations that are repetitive within a single request.  To help deal with this I'd like to create a sort of mini-cache that's scoped to a single request.  This is as opposed to a session-wide or application-wide cache, neither of which would make sense for my particular problem.
I thought I could just use a python global or module-level variable for this, but it turns out that those maintain their state between requests in non-obvious ways.
I also don't think memcache makes sense because it's application wide.
I haven't been able to find a good answer for this in google's docs.  Maybe that's because it's either a dumb idea or totally obvious, but it seems like it'd be useful and I'm stumped.
Anybody have any ideas?