def getArchiveList(): key_ = "blog_monthyear_key" try: monthlist = memcache.get(key_) except Exception: monthlist = None if monthlist is None: monthlist = Archive.gql('ORDER BY date desc').fetch(100) memcache.add(key=key_, value=monthlist, time=3600) else: logging.debug("getMonthYearList from cache. ") return monthlist