我想找到一种将缓存功能与瓶颈一起使用的方法,我找到了可以使用此代码执行此操作的地方,但不幸的是我不知道要导入什么才能使用缓存:
def reader(cache_url):
return cache.ram(cache_url,lambda: None,time_expire=86400) #Time expire can be any value you want (3600 = 1hour)
def writer(cache_url, response_text):
cache.ram(cache_url,lambda: response_text,time_expire=0) #Time Expire always 0 here
你能帮助我吗 ?
谢谢