Hi - I've been trying to get some performance improvements working on my site, one of which involves send back my HTML for one of my pages in chunks, so the browser can start processing it while the server does more work. The changes work locally, but seem not to work on PythonAnywhere.
Simple test case:
@app.route('/slow_test')
def slow_test():
def generate():
for i in range(10):
yield f"<b>The value is {i}<b><br>"
sleep(0.5)
return Response(stream_with_context(generate()))
This should show the numbers appearing one at a time in the browser, and indeed this is what I see locally. Is there a reason why this would behave differently on the server?