From 6eb7e72dcafd20d21fb046af6013f891494ce33c Mon Sep 17 00:00:00 2001 From: Rizqi Date: Tue, 23 Jun 2026 00:36:04 +0700 Subject: [PATCH] chore: update Gunicorn bind address to 0.0.0.0 and disable browser caching for dynamic routes --- ecosystem.config.js | 2 +- gui_app.py | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ecosystem.config.js b/ecosystem.config.js index 3668d28..22b648e 100644 --- a/ecosystem.config.js +++ b/ecosystem.config.js @@ -7,7 +7,7 @@ module.exports = { args: [ '--workers', '1', '--threads', '4', - '--bind', '127.0.0.1:5000', + '--bind', '0.0.0.0:5000', '--timeout', '300', // long timeout for backup operations '--keep-alive', '5', '--log-level', 'info', diff --git a/gui_app.py b/gui_app.py index b371e61..c552e29 100644 --- a/gui_app.py +++ b/gui_app.py @@ -1255,6 +1255,16 @@ def startswith_filter(value, prefix): return str(value).startswith(prefix) +@app.after_request +def add_header(r): + """Prevent caching of dynamic pages by the browser.""" + if not request.path.startswith('/static/'): + r.headers["Cache-Control"] = "no-cache, no-store, must-revalidate" + r.headers["Pragma"] = "no-cache" + r.headers["Expires"] = "0" + return r + + # ── NFS Management Routes ───────────────────────────────────────────────────────── @app.route('/nfs')