跳转到主要内容

为端点提供基本的缓存工具

项目描述

Alpha License: LGPL-3 OCA/web-api Translate me on Weblate Try me on Runboat

技术模块提供端点的基本缓存配置和工具。

目录

用法

端点中使用的示例

# get the name of the cache
cache_name = endpoint._endpoint_cache_make_name("json")
# check if the cache exists
cached = endpoint._endpoint_cache_get(cache_name)
if cached:
    result = cached
else:
    result = json.dumps(env["my.model"]._get_a_very_expensive_computed_result())
    # cache does not exist, create it
    endpoint._endpoint_cache_store(cache_name, result)

resp = Response(result, content_type="application/json", status=200)
result = dict(response=resp)

已知问题/路线图

  • 添加缓存预热

错误跟踪器

错误在GitHub问题上跟踪。如果在那里遇到问题,请检查您的问题是否已被报告。如果您是第一个发现它的人,请通过提供详细且受欢迎的反馈来帮助我们解决问题。

请不要直接联系贡献者以寻求支持或技术问题的帮助。

致谢

作者

  • Camptocamp

贡献者

维护者

此模块由OCA维护。

Odoo Community Association

OCA,或Odoo社区协会,是一个非营利组织,其使命是支持Odoo功能的协作开发并促进其广泛应用。

当前 维护者

simahawk

此模块是GitHub上的OCA/web-api项目的一部分。

欢迎您贡献。有关如何贡献的详细信息,请访问https://odoo-community.org/page/Contribute

项目详情


下载文件

下载适合您平台的文件。如果您不确定该选择哪个,请了解有关 安装包 的更多信息。

源代码分发

本发布没有提供源代码分发文件。请参阅有关 生成分发存档 的教程。

构建分发

odoo14_addon_endpoint_cache-14.0.1.1.1-py3-none-any.whl (25.5 kB 查看哈希值)

上传时间 Python 3

由...

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误日志 StatusPage StatusPage 状态页面