微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Beaker Python 高速缓存和会话库

程序名称:Beaker

授权协议: BSD

操作系统: 跨平台

开发语言: Python

Beaker 介绍

beaker,高速缓存和会话的库,用于Web应用以及独立的Python脚本。这个库还包含用于Web应用的Wsgi中间件。beaker 基于 Perl
Cache::Cache 开发。

特性:

示例代码

# Assuming that cache is an already created CacheManager instance
tmpl_cache = cache.get_cache('mytemplate.html', type='dbm', expire=3600)

search_param = 'gophers'

def get_results():
    # do something to retrieve data
    data = get_data(search_param)
    return data

# Cache this function, based on the search_param, using the tmpl_cache
# instance from the prior example
results = tmpl_cache.get(key=search_param, createfunc=get_results)

Beaker 官网

https://beaker.readthedocs.org/

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐