Cache Management
Caching Strategy Overview
Your newsroom application uses a multi-layered caching strategy:
- Service Worker Cache - Caches JS, CSS, fonts, and images for offline access
- Browser Cache - HTTP cache headers for optimal browser caching
- Asset Versioning - Content-hashed filenames for cache busting
Cache Types Explained
- Assets Cache (newsroom-assets-v1)
- Stores JS files, CSS files, fonts, and images. Uses "cache-first" strategy for fast loading.
- Static Cache (newsroom-static-v1)
- Stores static pages like About, Roadmap, etc. Uses "network-first" strategy for fresh content.
- Runtime Cache (newsroom-runtime-v1)
- Stores API responses and dynamic content with short expiration times.
Asset Caching Details
The following asset types are automatically cached:
- JavaScript files (.js) - Cached for 30 days
- CSS files (.css) - Cached for 30 days
- Font files (.woff2, .woff, .ttf) - Cached for 1 year
- Images (.png, .jpg, .svg, .ico) - Cached for 30 days
- Static pages - Cached for 1 day with network-first strategy
Performance Benefits
- Faster page loads after first visit
- Reduced bandwidth usage
- Better offline experience
- Automatic cache invalidation when assets change