refresh issues

This commit is contained in:
Jake Kasper
2025-09-04 10:21:12 -05:00
parent 3ddbc32fe0
commit e4524432e7
3 changed files with 30 additions and 3 deletions

View File

@@ -137,3 +137,14 @@ app.listen(PORT, '0.0.0.0', () => {
console.log(`TurfTracker API server running on port ${PORT}`);
console.log(`Environment: ${process.env.NODE_ENV || 'development'}`);
});
// Disable etags and set no-store by default to avoid stale cached API responses
app.set('etag', false);
app.use((req, res, next) => {
// Allow icon proxy to control its own caching
if (req.path && req.path.startsWith('/api/weather/icon')) return next();
res.setHeader('Cache-Control', 'no-store');
res.setHeader('Pragma', 'no-cache');
res.setHeader('Expires', '0');
next();
});