I have a flask app where using one Flask route
the server creates a csv file and saves it to the server. Using a generated button on the client page, another Flask
send_file
has a caching timeout that you are not configuring. It will send the same file that has been cached unless you tell it not to cache the file like so:
send_file('./tmp/{}'.format(basename), as_attachment=True, cache_timeout=0)
See the following references for more information:
http://flask.pocoo.org/docs/1.0/api/#flask.send_file
http://flask.pocoo.org/docs/1.0/api/#flask.Flask.get_send_file_max_age
http://flask.pocoo.org/docs/1.0/config/#SEND_FILE_MAX_AGE_DEFAULT