lru_cache - jenhaoyang/backend_blog GitHub Wiki

@lru_cache(5) 
def foo(): 
  print('Executing foo...')

foo.cache_info() #取得cache資訊
foo.cache_clear() #清除cache

參考:
https://dbader.org/blog/python-memoization
https://stackoverflow.com/a/37654201