chore: update Gunicorn bind address to 0.0.0.0 and disable browser caching for dynamic routes

This commit is contained in:
Rizqi 2026-06-23 00:36:04 +07:00
parent b99755771e
commit 6eb7e72dca
2 changed files with 11 additions and 1 deletions

View File

@ -7,7 +7,7 @@ module.exports = {
args: [ args: [
'--workers', '1', '--workers', '1',
'--threads', '4', '--threads', '4',
'--bind', '127.0.0.1:5000', '--bind', '0.0.0.0:5000',
'--timeout', '300', // long timeout for backup operations '--timeout', '300', // long timeout for backup operations
'--keep-alive', '5', '--keep-alive', '5',
'--log-level', 'info', '--log-level', 'info',

View File

@ -1255,6 +1255,16 @@ def startswith_filter(value, prefix):
return str(value).startswith(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 ───────────────────────────────────────────────────────── # ── NFS Management Routes ─────────────────────────────────────────────────────────
@app.route('/nfs') @app.route('/nfs')