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):
|
if not os.path.exists(output_path):
|
||||||
return jsonify({'error': 'File not found'}), 404
|
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:
|
except Exception as e:
|
||||||
return jsonify({'error': str(e)}), 500
|
return jsonify({'error': str(e)}), 500
|
||||||
|
|
||||||
|
|||||||
@@ -1253,9 +1253,9 @@
|
|||||||
throw new Error(data.error || 'Processing failed');
|
throw new Error(data.error || 'Processing failed');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load processed video preview
|
// Load processed video preview with cache-busting
|
||||||
const processedVideoPreview = document.getElementById('processed-video-preview');
|
const processedVideoPreview = document.getElementById('processed-video-preview');
|
||||||
processedVideoPreview.src = `/preview/${currentFileId}`;
|
processedVideoPreview.src = `/preview/${currentFileId}?t=${Date.now()}`;
|
||||||
|
|
||||||
// Show download section
|
// Show download section
|
||||||
document.getElementById('edit-section').classList.add('hidden');
|
document.getElementById('edit-section').classList.add('hidden');
|
||||||
|
|||||||
Reference in New Issue
Block a user