mirror of
https://github.com/ipnet-mesh/meshcore-hub.git
synced 2026-03-28 17:42:56 +01:00
Implement cache-control middleware to optimize browser caching and reduce bandwidth usage. Static files are cached for 1 year when accessed with version parameters, while dynamic content is never cached. Changes: - Add CacheControlMiddleware with path-based caching logic - Register middleware in web app after ProxyHeadersMiddleware - Add version query parameters to CSS, JS, and app.js references - Create comprehensive test suite (20 tests) for all cache behaviors Cache strategy: - Static files with ?v=X.Y.Z: 1 year (immutable) - Static files without version: 1 hour (fallback) - SPA shell HTML: no-cache (dynamic config) - Health endpoints: no-cache, no-store (always fresh) - Map data: 5 minutes (location updates) - Custom pages: 1 hour (stable markdown) - API proxy: pass-through (backend controls) All 458 tests passing, 95% middleware coverage. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>