tractatus/src/middleware
TheFlow 6aed0dd275 fix(cache): prevent caching of admin files and API responses
CRITICAL FIX: Automatic cache invalidation for admin JavaScript files.

Root cause: Service worker and browser cache serving stale admin files
even after deploying fixes. Users had to manually clear cache daily.

Changes:
1. Service Worker (v0.1.2):
   - Added NEVER_CACHE_PATHS for /js/admin/, /api/, /admin/
   - These paths now ALWAYS fetch from network, never cache
   - Bumped version to trigger cache clear on all clients

2. Server-side Cache Control:
   - Added Cache-Control: no-store headers for admin/API paths
   - Added Pragma: no-cache and Expires: 0 for belt-and-suspenders
   - Prevents browser AND proxy caching

This ensures:
- Admin JavaScript updates deploy immediately
- API responses are never stale
- No more manual cache clearing required

Testing:
- Admin files will now always be fresh from server
- Service worker will auto-update to v0.1.2 on next visit
- Browsers will respect no-cache headers going forward

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 18:34:06 +13:00
..
tractatus feat: implement Tractatus governance framework - core AI safety services 2025-10-07 00:51:57 +13:00
analytics.middleware.js fix(submissions): restructure Economist package and fix article display 2025-10-24 08:47:42 +13:00
auth.middleware.js fix(submissions): restructure Economist package and fix article display 2025-10-24 08:47:42 +13:00
csrf-protection.middleware.js fix(csrf): enable newsletter subscription from mobile 2025-10-24 16:42:56 +13:00
error.middleware.js feat: add Express server foundation with middleware 2025-10-06 23:56:12 +13:00
file-security.middleware.js fix(submissions): restructure Economist package and fix article display 2025-10-24 08:47:42 +13:00
input-validation.middleware.js security: implement quick wins (80/20 approach) + full 6-phase tracker 2025-10-14 14:58:42 +13:00
rate-limit.middleware.js fix(submissions): restructure Economist package and fix article display 2025-10-24 08:47:42 +13:00
response-sanitization.middleware.js fix(submissions): restructure Economist package and fix article display 2025-10-24 08:47:42 +13:00
security-headers.middleware.js fix(cache): prevent caching of admin files and API responses 2025-10-24 18:34:06 +13:00
validation.middleware.js feat: implement AI-powered features (Phase 1 Core) 2025-10-08 00:14:00 +13:00