the-blue-alliance/the-blue-alliance — pull request #1042 by fangeugene (2014-06-10 22:54:59+00:00)
Title: Cache API v2 responses in the datastore

Cleaner and fixes some of the issues in #1026.

Responses to @gregmarra's comments in #1026:
- We should fix the `full_cache_key` naming issue in another PR
- Cleanup can be based on `updated` (this doesn't necessarily clear stale entries, just ones that are old-ish) or just left around permanently per controller version.
- No, the current memcache mechanism is no longer needed, since ndb.get_by_id checks memcache first
- This makes any API call, once accessed onced, at most one DB access, maybe zero if it's in memcache, and doesn't need to run `model_to_dict`. Versus the current (depending on endpoint) 1-100s of DB accesses and running of `model_to_dict`.