gregmarra/the-blue-alliance — pull request #649 by fangeugene (2013-06-06 08:05:56+00:00)
Title: Datastore cache

Feel free to reject the pull request if you don't think this will be much help. I'm experimenting with caching full rendered pages in the datastore, and should be used in conjunction with memcache. I tried to make the API as similar to that of memcache. Ideally, old pages from previous years should be able to be maintained in datastorecache until we make changes to page templates, for example. Theoretically, DatastoreCache.cleanup() never needs to be run, given that we are properly incrementing cache versions and aren't worrying about storage space.

As an aside, using expiration time to clear cache (for both memcache and datastore cache) is not ideal, both in terms of keeping items in cache as long as possible and in terms of having the site reflect changes with minimal delay. As mentioned many times before we should really look into proper cache expiration methods.