nginx with flask and memcached returns some garbled characters nginx with flask and memcached returns some garbled characters nginx nginx

nginx with flask and memcached returns some garbled characters


Yay, I fixed it! The nginx configuration was correct before I changed chunked, the python/flask code however should have been:

@app.route('/')def index():    rv = cache.get('request:/')    if rv == None:        rv = render_template('index.html')        cachable = make_response(rv).data        cache.set('request:/', cachable, timeout=5 * 60)    return rv

That is, I should only cache the data, and that can only be done, afaik, if I do make_response first