【问题标题】:How to flush memcache from appcfg.py?如何从 appcfg.py 刷新内存缓存?
【发布时间】:2014-09-16 07:57:28
【问题描述】:

如何使用appcfg.py 刷新(删除所有条目)内存缓存?

通常在代码更新期间,我想刷新内存缓存以防止新旧代码之间不兼容。是否可以在命令行上完成,而不是去开发者控制台手动点击“Flush Cache”按钮?

【问题讨论】:

    标签: google-app-engine memcached flush appcfg


    【解决方案1】:

    抱歉,不,命令行工具没有刷新正在运行的应用程序的内存缓存的功能。

    您可以通过 memcache API 的 flush 方法(例如 Python 中的 flush_all())检测您自己的命令行 memcache 刷新。您可以通过以下两种方式之一构建它:1) 使用 Cloud Endpoints 和 Google API 客户端创建您自己的经过身份验证的端点和命令行客户端来调用它,并让端点调用该方法。或者,2)使用内置的远程API代理和相应的客户端库来调用memcache API。

    https://developers.google.com/appengine/docs/python/memcache/functions#Client_flush_all

    https://developers.google.com/appengine/docs/python/tools/remoteapi https://developers.google.com/appengine/docs/java/tools/remoteapi

    https://developers.google.com/appengine/docs/java/endpoints/ https://developers.google.com/discovery/libraries

    它并不像听起来那么疯狂,如果它很重要的话。 :)

    【讨论】:

    • 以下工作(经过身份验证后):echo "memcache.flush_all()" | remote_api_shell.py -s $app_id.appspot.com。在一些基准测试脚本中证明很方便。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-07-02
    • 2018-11-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多