def ping(): Cache.set('ok', 'test') Cache.expire('ok', 5)
def ok(): a = Cache.get('ok') if a: return a else: return 'error'