python - Gunicorn 不提供更新的 Flask 应用程序(带有 Flask 缓存)
问题描述
我有一个非常简单的 Flask 应用程序,它缓存了一个视图函数
app = Flask(__name__)
cache = Cache(app, config={'CACHE_TYPE': 'simple'})
@app.route("/")
@cache.cached(timeout=50)
def index():
# code pulls data to put to index.html
# ...
return render_template('index.html')
我明确设置了 50 秒的超时,以便我可以检索新数据并更新index.html
。
我通过 Gunicorn 为我的应用程序提供服务,除了使用eventlet
工作人员之外没有任何花哨的参数,但 Gunicorn 没有提供更新的index.html
. 我也在nginx
gunicorn前面,但我怀疑问题出在Gunicorn ...
解决方案
推荐阅读
- android - Android studio 4.1 一些断点没有触发
- android - 如何使用“Material Components for Android”库
- javascript - 当鼠标悬停在另一个 div 上时更改 div 的背景图像
- math - 如何在LUA(或一般)中非线性映射两个数字范围?
- html - 尝试访问 DOM 的 clientWidth 和 clientHeight 引用时出现 Vue 问题
- python - 用python实现http请求
- c++ - 在 for 循环 C++ 中调用 Void 函数
- java - 如何使用流将列表中的选定元素复制到另一个列表
- html - last-child 适用于所有链接,但应该适用于一个?
- sql-server - 通过 KeyVault 从 Azure 功能连接到 SQL Server