prevent cache
All checks were successful
Build Images and Deploy / Update-PROD-Stack (push) Successful in 1m9s
All checks were successful
Build Images and Deploy / Update-PROD-Stack (push) Successful in 1m9s
This commit is contained in:
7
app.py
7
app.py
@@ -221,7 +221,12 @@ def preview_video(file_id):
|
||||
if not os.path.exists(output_path):
|
||||
return jsonify({'error': 'File not found'}), 404
|
||||
|
||||
return send_file(output_path, mimetype='video/mp4')
|
||||
response = send_file(output_path, mimetype='video/mp4')
|
||||
# Prevent caching
|
||||
response.headers['Cache-Control'] = 'no-store, no-cache, must-revalidate, max-age=0'
|
||||
response.headers['Pragma'] = 'no-cache'
|
||||
response.headers['Expires'] = '0'
|
||||
return response
|
||||
except Exception as e:
|
||||
return jsonify({'error': str(e)}), 500
|
||||
|
||||
|
||||
Reference in New Issue
Block a user