fix: Add cache-control headers to GET /api/settings to prevent browser caching
- Settings were being cached by browser, causing stale values on refresh - Added no-store, no-cache, must-revalidate headers - Ensures fresh settings are always fetched from database
This commit is contained in:
1 parent
40c65e1163
commit
0465d7ffad
1 file changed
+5
@@ -516,6 +516,11 @@ app.post('/api/notifications/clear', (req, res) => {
|
||||
|
||||
// Get settings
|
||||
app.get('/api/settings', (req, res) => {
|
||||
// Prevent browser caching - always fetch fresh data
|
||||
res.set('Cache-Control', 'no-store, no-cache, must-revalidate, proxy-revalidate');
|
||||
res.set('Pragma', 'no-cache');
|
||||
res.set('Expires', '0');
|
||||
|
||||
// Try to get settings from database first, fallback to process.env
|
||||
try {
|
||||
const dbSettings = {};
|
||||
|
||||
Reference in new issue
Block a user